Changeset 956 in MondoRescue for trunk/mondo/src/mondorestore/mondo-restore.c
- Timestamp:
- Nov 21, 2006, 1:42:46 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/mondorestore/mondo-restore.c
r932 r956 127 127 char *ps_options = ""; 128 128 char *ps_proc_id = "$1"; 129 130 extern char *g_getfacl; 131 extern char *g_getfattr; 129 132 130 133 /* @} - end of "Restore-Time Globals" in globalGroup */ … … 1609 1612 1610 1613 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, 1612 1616 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", 1614 1620 current_tarball_number); 1621 } 1615 1622 if (strstr(tarball_fname, ".bz2")) { 1616 1623 mr_asprintf(&executable, "bzip2"); … … 1689 1696 } 1690 1697 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) { 1704 1712 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 } 1714 1723 } 1715 1724 if (retval) { … … 1888 1897 paranoid_system(command); 1889 1898 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 } 1906 1920 1907 1921 } else { … … 2046 2060 if (fbw) { 2047 2061 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 } 2055 2073 } 2056 2074 mr_free(acl_fname); … … 2266 2284 2267 2285 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 } 2270 2292 mvaddstr_and_log_it(g_currentY, 0, tmp); 2271 2293 mr_free(tmp); … … 2352 2374 if (length_of_file(biggies_whose_EXATs_we_should_set) > 2) { 2353 2375 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)", 2361 2379 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, 2363 2381 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 } 2364 2390 } 2365 2391 } else { … … 2454 2480 while (ctrl_chr != BLK_STOP_AFIOBALLS) { 2455 2481 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, 2457 2484 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, 2459 2489 current_afioball_number); 2460 unlink(xattr_fname);2461 unlink(acl_fname);2490 unlink(acl_fname); 2491 } 2462 2492 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 2463 2493 iamhere("Reading EXAT files from tape"); … … 2503 2533 res = 2504 2534 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 } 2507 2541 mr_free(xattr_fname); 2508 2542 mr_free(acl_fname);
Note:
See TracChangeset
for help on using the changeset viewer.