Changeset 956 in MondoRescue for trunk/mondo/src/mondorestore/mondo-restore.c


Ignore:
Timestamp:
Nov 21, 2006, 1:42:46 AM (17 years ago)
Author:
Bruno Cornec
Message:

merge -r938:954 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r932 r956  
    127127char *ps_options = "";
    128128char *ps_proc_id = "$1";
     129
     130extern char *g_getfacl;
     131extern char *g_getfattr;
    129132
    130133/* @} - end of "Restore-Time Globals" in globalGroup */
     
    16091612
    16101613    if (filelist == NULL || matches > 0) {
    1611         mr_asprintf(&xattr_fname, XATTR_LIST_FNAME_RAW_SZ,
     1614        if (g_getfattr) {
     1615            mr_asprintf(&xattr_fname, XATTR_LIST_FNAME_RAW_SZ,
    16121616                MNT_CDROM "/archives", current_tarball_number);
    1613         mr_asprintf(&acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives",
     1617        }
     1618        if (g_getfacl) {
     1619            mr_asprintf(&acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives",
    16141620                current_tarball_number);
     1621        }
    16151622        if (strstr(tarball_fname, ".bz2")) {
    16161623            mr_asprintf(&executable, "bzip2");
     
    16891696        }
    16901697
    1691         log_msg(1, "Setting fattr list %s", xattr_fname);
    1692         if (length_of_file(xattr_fname) > 0) {
    1693             res = set_fattr_list(filelist_subset_fname, xattr_fname);
    1694             if (res) {
    1695                 log_to_screen
    1696                     (_
    1697                      ("Errors occurred while setting extended attributes"));
    1698             } else {
    1699                 log_msg(1, "I set xattr OK");
    1700             }
    1701             retval += res;
    1702         }
    1703         if (length_of_file(acl_fname) > 0) {
     1698        if (g_getfattr) {
     1699            log_msg(1, "Setting fattr list %s", xattr_fname);
     1700            if (length_of_file(xattr_fname) > 0) {
     1701                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     1702                if (res) {
     1703                    log_to_screen
     1704                        ("Errors occurred while setting extended attributes");
     1705                } else {
     1706                    log_msg(1, "I set xattr OK");
     1707                }
     1708                retval += res;
     1709            }
     1710        }
     1711        if (g_getfacl) {
    17041712            log_msg(1, "Setting acl list %s", acl_fname);
    1705             res = set_acl_list(filelist_subset_fname, acl_fname);
    1706             if (res) {
    1707                 log_to_screen
    1708                     (_
    1709                      ("Errors occurred while setting access control lists"));
    1710             } else {
    1711                 log_msg(1, "I set ACL OK");
    1712             }
    1713             retval += res;
     1713            if (length_of_file(acl_fname) > 0) {
     1714                res = set_acl_list(filelist_subset_fname, acl_fname);
     1715                if (res) {
     1716                    log_to_screen
     1717                        ("Errors occurred while setting access control lists");
     1718                } else {
     1719                    log_msg(1, "I set ACL OK");
     1720                }
     1721                retval += res;
     1722            }
    17141723        }
    17151724        if (retval) {
     
    18881897        paranoid_system(command);
    18891898
    1890         iamhere("Restoring xattr, acl stuff");
    1891         res = set_fattr_list(filelist_subset_fname, xattr_fname);
    1892         if (res) {
    1893             log_msg(1, "Errors occurred while setting xattr");
    1894         } else {
    1895             log_msg(1, "I set xattr OK");
    1896         }
    1897         retval += res;
    1898 
    1899         res = set_acl_list(filelist_subset_fname, acl_fname);
    1900         if (res) {
    1901             log_msg(1, "Errors occurred while setting ACL");
    1902         } else {
    1903             log_msg(1, "I set ACL OK");
    1904         }
    1905         retval += res;
     1899        if (g_getfattr) {
     1900            iamhere("Restoring xattr stuff");
     1901            res = set_fattr_list(filelist_subset_fname, xattr_fname);
     1902            if (res) {
     1903                log_msg(1, "Errors occurred while setting xattr");
     1904            } else {
     1905                log_msg(1, "I set xattr OK");
     1906            }
     1907            retval += res;
     1908        }
     1909
     1910        if (g_getfacl) {
     1911            iamhere("Restoring acl stuff");
     1912            res = set_acl_list(filelist_subset_fname, acl_fname);
     1913            if (res) {
     1914                log_msg(1, "Errors occurred while setting ACL");
     1915            } else {
     1916                log_msg(1, "I set ACL OK");
     1917            }
     1918            retval += res;
     1919        }
    19061920
    19071921    } else {
     
    20462060    if (fbw) {
    20472061        fclose(fbw);
    2048         mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2049         mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2050         if (length_of_file(acl_fname) > 0) {
    2051             set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    2052         }
    2053         if (length_of_file(xattr_fname) > 0) {
    2054             set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
     2062        if (g_getfattr) {
     2063            mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
     2064            if (length_of_file(xattr_fname) > 0) {
     2065                set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
     2066            }
     2067        }
     2068        if (g_getfacl) {
     2069            mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
     2070            if (length_of_file(acl_fname) > 0) {
     2071                set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     2072            }
    20552073        }
    20562074        mr_free(acl_fname);
     
    22662284
    22672285    mr_asprintf(&tmp, "Reassembling large files      ");
    2268     mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
    2269     mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2286    if (g_getfattr) {
     2287        mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2288    }
     2289    if (g_getfacl) {
     2290        mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2291    }
    22702292    mvaddstr_and_log_it(g_currentY, 0, tmp);
    22712293    mr_free(tmp);
     
    23522374        if (length_of_file(biggies_whose_EXATs_we_should_set) > 2) {
    23532375            iamhere("Setting biggie-EXATs");
    2354             if (length_of_file(acl_fname) > 0) {
    2355                 log_msg(1, "set_acl_list(%s,%s)",
    2356                         biggies_whose_EXATs_we_should_set, acl_fname);
    2357                 set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    2358             }
    2359             if (length_of_file(xattr_fname) > 0) {
    2360                 log_msg(1, "set_fattr_List(%s,%s)",
     2376            if (g_getfattr) {
     2377                if (length_of_file(xattr_fname) > 0) {
     2378                    log_msg(1, "set_fattr_List(%s,%s)",
    23612379                        biggies_whose_EXATs_we_should_set, xattr_fname);
    2362                 set_fattr_list(biggies_whose_EXATs_we_should_set,
     2380                    set_fattr_list(biggies_whose_EXATs_we_should_set,
    23632381                               xattr_fname);
     2382                }
     2383            }
     2384            if (g_getfacl) {
     2385                if (length_of_file(acl_fname) > 0) {
     2386                    log_msg(1, "set_acl_list(%s,%s)",
     2387                            biggies_whose_EXATs_we_should_set, acl_fname);
     2388                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     2389                }
    23642390            }
    23652391        } else {
     
    24542480    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
    24552481        update_progress_form(progress_str);
    2456         mr_asprintf(&xattr_fname, "%s/xattr-subset-%ld.tmp", bkpinfo->tmpdir,
     2482        if (g_getfattr) {
     2483            mr_asprintf(&xattr_fname, "%s/xattr-subset-%ld.tmp", bkpinfo->tmpdir,
    24572484                current_afioball_number);
    2458         mr_asprintf(&acl_fname, "%s/acl-subset-%ld.tmp", bkpinfo->tmpdir,
     2485            unlink(xattr_fname);
     2486        }
     2487        if (g_getfacl) {
     2488            mr_asprintf(&acl_fname, "%s/acl-subset-%ld.tmp", bkpinfo->tmpdir,
    24592489                current_afioball_number);
    2460         unlink(xattr_fname);
    2461         unlink(acl_fname);
     2490            unlink(acl_fname);
     2491        }
    24622492        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    24632493            iamhere("Reading EXAT files from tape");
     
    25032533        res =
    25042534            read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    2505         unlink(xattr_fname);
    2506         unlink(acl_fname);
     2535        if (g_getfattr) {
     2536            unlink(xattr_fname);
     2537        }
     2538        if (g_getfacl) {
     2539            unlink(acl_fname);
     2540        }
    25072541        mr_free(xattr_fname);
    25082542        mr_free(acl_fname);
Note: See TracChangeset for help on using the changeset viewer.