Changeset 948 in MondoRescue for branches/stable/mondo


Ignore:
Timestamp:
Nov 19, 2006, 1:27:46 AM (17 years ago)
Author:
Bruno Cornec
Message:
  • mondoarchive does not backup acl+xattr by default anymore
  • Add -z option to mondoarchive to support acl+xattr backup
  • small mindi fix
  • this may break mondo compatibility so tests are required before distributing that version.
  • this is still incomplete as that aprameter should be passed for mondorestore to know what to do.
Location:
branches/stable/mondo/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-archive.c

    r911 r948  
    234234extern bool g_cd_recovery;
    235235extern char *g_serial_string;
     236
     237extern char *g_getfacl;
     238extern char *g_getfattr;
     239
     240
    236241
    237242/**
     
    11121117    char *archiving_filelist_fname;
    11131118    char *archiving_afioball_fname;
    1114     char *curr_xattr_list_fname;
     1119    char *curr_xattr_list_fname = NULL;
    11151120    char *curr_acl_list_fname;
    11161121
     
    11851190        log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
    11861191                this_thread_no, archiving_set_no);
    1187         sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     1192        if (g_getfattr) {
     1193            sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    11881194                bkpinfo->tmpdir, archiving_set_no);
    1189         sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     1195            get_fattr_list(archiving_filelist_fname, curr_xattr_list_fname);
     1196        }
     1197        if (g_getfacl) {
     1198            sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    11901199                bkpinfo->tmpdir, archiving_set_no);
    1191         get_fattr_list(archiving_filelist_fname, curr_xattr_list_fname);
    1192         get_acl_list(archiving_filelist_fname, curr_acl_list_fname);
     1200            get_acl_list(archiving_filelist_fname, curr_acl_list_fname);
     1201        }
    11931202
    11941203        log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
     
    15891598    int noof_threads;
    15901599    int i;
    1591     char *curr_xattr_list_fname;
     1600    char *curr_xattr_list_fname = NULL;
    15921601    char *curr_acl_list_fname;
    15931602    int misc_counter_that_is_not_important = 0;
     
    16761685            sprintf(storing_afioball_fname, AFIOBALL_FNAME_RAW_SZ,
    16771686                    bkpinfo->tmpdir, storing_set_no, bkpinfo->zip_suffix);
    1678             sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     1687            if (g_getfattr) {
     1688                sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    16791689                    bkpinfo->tmpdir, storing_set_no);
    1680             sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     1690            }
     1691            if (g_getfacl) {
     1692                sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    16811693                    bkpinfo->tmpdir, storing_set_no);
     1694            }
    16821695
    16831696            log_msg(2, "Storing set %d", storing_set_no);
     
    17071720                                         NULL);
    17081721            } else {
    1709                 res =
    1710                     move_files_to_cd(bkpinfo, storing_filelist_fname,
     1722                if (g_getfacl) {
     1723                    if (g_getfattr) {
     1724                        res = move_files_to_cd(bkpinfo, storing_filelist_fname,
    17111725                                     curr_xattr_list_fname,
    17121726                                     curr_acl_list_fname,
    17131727                                     storing_afioball_fname, NULL);
     1728                    } else {
     1729                        res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1730                                    curr_acl_list_fname,
     1731                                    storing_afioball_fname, NULL);
     1732                    }
     1733                } else {
     1734                    if (g_getfattr) {
     1735                            res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1736                                    curr_xattr_list_fname,
     1737                                    storing_afioball_fname, NULL);
     1738                    } else {
     1739                            res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1740                                    storing_afioball_fname, NULL);
     1741                    }
     1742                }
    17141743            }
    17151744            retval += res;
     
    23702399
    23712400        log_msg(1, "EXAT'g set %ld", curr_set_no);
    2372         sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     2401        if (g_getfattr) {
     2402            sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    23732403                bkpinfo->tmpdir, curr_set_no);
    2374         sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     2404            get_fattr_list(curr_filelist_fname, curr_xattr_list_fname);
     2405        }
     2406        if (g_getfacl) {
     2407            sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    23752408                bkpinfo->tmpdir, curr_set_no);
    2376         get_fattr_list(curr_filelist_fname, curr_xattr_list_fname);
    2377         get_acl_list(curr_filelist_fname, curr_acl_list_fname);
     2409            get_acl_list(curr_filelist_fname, curr_acl_list_fname);
     2410        }
    23782411
    23792412        log_msg(1, "Archiving set %ld", curr_set_no);
     
    24042437            res = move_files_to_stream(bkpinfo, curr_afioball_fname, NULL);
    24052438        } else {
    2406             res =
    2407                 move_files_to_cd(bkpinfo, curr_filelist_fname,
    2408                                  curr_xattr_list_fname,
    2409                                  curr_acl_list_fname, curr_afioball_fname,
    2410                                  NULL);
     2439                if (g_getfacl) {
     2440                    if (g_getfattr) {
     2441                        res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2442                                     curr_xattr_list_fname,
     2443                                     curr_acl_list_fname,
     2444                                     curr_afioball_fname, NULL);
     2445                    } else {
     2446                        res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2447                                    curr_acl_list_fname,
     2448                                    curr_afioball_fname, NULL);
     2449                    }
     2450                } else {
     2451                    if (g_getfattr) {
     2452                            res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2453                                    curr_xattr_list_fname,
     2454                                    curr_afioball_fname, NULL);
     2455                    } else {
     2456                            res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2457                                    curr_afioball_fname, NULL);
     2458                    }
     2459                }
    24112460        }
    24122461        retval += res;
     
    25202569                        "Archiving large files to media           ");
    25212570    sprintf(biggielist, "%s/archives/biggielist.txt", bkpinfo->scratchdir);
    2522     sprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
    2523     sprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2571    if (g_getfattr) {
     2572        sprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2573    }
     2574    if (g_getfacl) {
     2575        sprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2576    }
    25242577
    25252578    sprintf(command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,
     
    25332586    }
    25342587
    2535     get_fattr_list(biggielist, xattr_fname);
    2536     get_acl_list(biggielist, acl_fname);
    2537     sprintf(command, "cp %s %s/archives/", xattr_fname,
     2588    if (g_getfattr) {
     2589        get_fattr_list(biggielist, xattr_fname);
     2590        sprintf(command, "cp %s %s/archives/", xattr_fname,
    25382591            bkpinfo->scratchdir);
    2539     paranoid_system(command);
    2540     sprintf(command, "cp %s %s/archives/", acl_fname, bkpinfo->scratchdir);
    2541     paranoid_system(command);
     2592        paranoid_system(command);
     2593    }
     2594    if (g_getfacl) {
     2595        get_acl_list(biggielist, acl_fname);
     2596        sprintf(command, "cp %s %s/archives/", acl_fname, bkpinfo->scratchdir);
     2597        paranoid_system(command);
     2598    }
    25422599
    25432600    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
  • branches/stable/mondo/src/common/libmondo-stream.c

    r684 r948  
    115115extern bool g_sigpipe;
    116116extern int g_tape_buffer_size_MB;
     117
     118extern char *g_getfacl;
     119extern char *g_getfattr;
    117120
    118121/**
     
    443446
    444447// xattr
    445     res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    446     if (*pctrl_chr != BLK_START_EXAT_FILE) {
    447         wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    448     }
    449     if (!strstr(tmp_fname, "xattr")) {
    450         fatal_error("Wrong order, sunshine.");
    451     }
    452     read_file_from_stream_to_file(bkpinfo, xattr_fname, *ptmp_size);
    453     res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    454     if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
    455         wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
     448    if (g_getfattr) {
     449        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     450        if (*pctrl_chr != BLK_START_EXAT_FILE) {
     451            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
     452        }
     453        if (!strstr(tmp_fname, "xattr")) {
     454            fatal_error("Wrong order, sunshine.");
     455        }
     456        read_file_from_stream_to_file(bkpinfo, xattr_fname, *ptmp_size);
     457        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     458        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     459            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
     460        }
     461        log_msg(1, "Got xattr");
    456462    }
    457463// acl
    458     res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    459     if (!strstr(tmp_fname, "acl")) {
    460         fatal_error("Wrong order, sunshine.");
    461     }
    462     if (*pctrl_chr != BLK_START_EXAT_FILE) {
    463         wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    464     }
    465     read_file_from_stream_to_file(bkpinfo, acl_fname, *ptmp_size);
    466     res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    467     if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
    468         wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
    469     }
    470     res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    471     if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) {
    472         wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
     464    if (g_getfacl) {
     465        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     466        if (!strstr(tmp_fname, "acl")) {
     467            fatal_error("Wrong order, sunshine.");
     468        }
     469        if (*pctrl_chr != BLK_START_EXAT_FILE) {
     470            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
     471        }
     472        read_file_from_stream_to_file(bkpinfo, acl_fname, *ptmp_size);
     473        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     474        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     475            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
     476        }
     477        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     478        if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) {
     479            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
     480        }
     481        log_msg(1, "Got acl");
    473482    }
    474483// tarball itself
    475484    res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    476     log_msg(1, "Got xattr and acl; now looking for afioball");
     485    log_msg(1, "now looking for afioball");
    477486    return (retval);
    478487}
     
    483492{
    484493    int res = 0;
    485 // EXATs
    486     write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    487                                  BLK_START_EXTENDED_ATTRIBUTES);
     494    if (g_getfattr) {
    488495// xattr
    489     write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    490                                  BLK_START_EXAT_FILE);
    491     write_file_to_stream_from_file(bkpinfo, xattr_fname);
    492     write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
     496        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     497                             BLK_START_EXTENDED_ATTRIBUTES);
     498        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     499                             BLK_START_EXAT_FILE);
     500        write_file_to_stream_from_file(bkpinfo, xattr_fname);
     501        write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
     502    }
     503    if (g_getfacl) {
    493504// acl
    494     write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    495                                  BLK_START_EXAT_FILE);
    496     write_file_to_stream_from_file(bkpinfo, acl_fname);
    497     write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    498     write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    499                                  BLK_STOP_EXTENDED_ATTRIBUTES);
     505        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
     506                             BLK_START_EXAT_FILE);
     507        write_file_to_stream_from_file(bkpinfo, acl_fname);
     508        write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
     509        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     510                             BLK_STOP_EXTENDED_ATTRIBUTES);
     511    }
    500512    return (res);
    501513}
  • branches/stable/mondo/src/common/libmondo-verify.c

    r911 r948  
    124124int g_last_afioball_number = -1;
    125125
     126extern char *g_getfacl;
     127extern char *g_getfattr;
    126128
    127129/**
     
    807809    malloc_string(curr_acl_list_fname);
    808810
    809     sprintf(curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
     811    if (g_getfattr) {
     812        sprintf(curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
    810813            bkpinfo->tmpdir);
    811     sprintf(curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
     814    }
     815    if (g_getfacl) {
     816        sprintf(curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
    812817            bkpinfo->tmpdir);
     818    }
    813819    log_to_screen("Verifying regular archives on tape");
    814820    total_afioballs = get_last_filelist_number(bkpinfo) + 1;
     
    835841         ctrl_chr != BLK_STOP_AFIOBALLS;
    836842         res = read_header_block_from_stream(&size, fname, &ctrl_chr)) {
    837         sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     843        if (g_getfattr) {
     844            sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    838845                bkpinfo->tmpdir, current_afioball_number);
    839         sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     846        }
     847        if (g_getfacl) {
     848            sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    840849                bkpinfo->tmpdir, current_afioball_number);
     850        }
    841851        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    842852            iamhere("Reading EXAT files from tape");
     
    915925    malloc_string(curr_acl_list_fname);
    916926
    917     sprintf(curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
     927    if (g_getfattr) {
     928        sprintf(curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
    918929            bkpinfo->tmpdir);
    919     sprintf(curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
     930    }
     931    if (g_getfacl) {
     932        sprintf(curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
    920933            bkpinfo->tmpdir);
     934    }
    921935    sprintf(comment, "Verifying all bigfiles.");
    922936    log_to_screen(comment);
  • branches/stable/mondo/src/mondoarchive/main.c

    r945 r948  
    142142char *ps_options = "auxww";
    143143char *ps_proc_id = "$2";
    144 char *g_getfacl = NULL;
    145 char *g_getfattr = NULL;
    146144
    147145extern t_bkptype g_backup_media_type;
     
    458456            bkpinfo->scratchdir);
    459457
    460     if (find_home_of_exe("getfacl")) {
    461         asprintf(&g_getfacl,"getfacl");
    462     }
    463     if (find_home_of_exe("getfattr")) {
    464         asprintf(&g_getfattr,"getfattr");
    465     }
    466 
    467458    /* If we're meant to backup then backup */
    468459    if (bkpinfo->backup_data) {
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r910 r948  
    202202
    203203extern double g_kernel_version;
    204 
    205204extern int g_current_media_number;
    206 
    207 
    208 
    209205extern pid_t g_main_pid;
    210 
    211 
    212 
    213 
    214206extern char *resolve_softlinks_to_get_to_actual_device_file(char *);
    215207
    216 
     208/* Do we use extended attributes and acl ?
     209 * By default no, use --acl & --attr options to force their usage */
     210char *g_getfacl = NULL;
     211char *g_getfattr = NULL;
    217212
    218213/**
     
    673668        bkpinfo->backup_media_type = cdrw;
    674669    }
     670    if (flag_set['z']) {
     671        if (find_home_of_exe("getfattr")) {
     672            asprintf(&g_getfattr,"getfattr");
     673        }
     674        if (find_home_of_exe("getfacl")) {
     675            asprintf(&g_getfacl,"getfacl");
     676        }
     677    }
     678    }
    675679
    676680    /* optional, popular */
     
    10211025    while ((opt =
    10221026            getopt(argc, argv,
    1023                    "0123456789A:B:C:DE:FHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:"))
     1027                   "0123456789A:B:C:DE:FHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
    10241028           != -1) {
    10251029        if (opt == '?') {
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r947 r948  
    20272027
    20282028    if (filelist == NULL || matches > 0) {
    2029         sprintf(xattr_fname, XATTR_LIST_FNAME_RAW_SZ,
     2029        if (g_getfattr) {
     2030            sprintf(xattr_fname, XATTR_LIST_FNAME_RAW_SZ,
    20302031                MNT_CDROM "/archives", current_tarball_number);
    2031         sprintf(acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives",
     2032        }
     2033        if (g_getfacl) {
     2034            sprintf(acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives",
    20322035                current_tarball_number);
     2036        }
    20332037        if (strstr(tarball_fname, ".bz2")) {
    20342038            strcpy(executable, "bzip2");
     
    20952099        }
    20962100
    2097         log_msg(1, "Setting fattr list %s", xattr_fname);
    2098         if (length_of_file(xattr_fname) > 0) {
    2099             res = set_fattr_list(filelist_subset_fname, xattr_fname);
    2100             if (res) {
    2101                 log_to_screen
    2102                     ("Errors occurred while setting extended attributes");
    2103             } else {
    2104                 log_msg(1, "I set xattr OK");
    2105             }
    2106             retval += res;
    2107         }
    2108         if (length_of_file(acl_fname) > 0) {
     2101        if (g_getfattr) {
     2102            log_msg(1, "Setting fattr list %s", xattr_fname);
     2103            if (length_of_file(xattr_fname) > 0) {
     2104                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     2105                if (res) {
     2106                    log_to_screen
     2107                        ("Errors occurred while setting extended attributes");
     2108                } else {
     2109                    log_msg(1, "I set xattr OK");
     2110                }
     2111                retval += res;
     2112            }
     2113        }
     2114        if (g_getfacl) {
    21092115            log_msg(1, "Setting acl list %s", acl_fname);
    2110             res = set_acl_list(filelist_subset_fname, acl_fname);
    2111             if (res) {
    2112                 log_to_screen
    2113                     ("Errors occurred while setting access control lists");
    2114             } else {
    2115                 log_msg(1, "I set ACL OK");
    2116             }
    2117             retval += res;
     2116            if (length_of_file(acl_fname) > 0) {
     2117                res = set_acl_list(filelist_subset_fname, acl_fname);
     2118                if (res) {
     2119                    log_to_screen
     2120                        ("Errors occurred while setting access control lists");
     2121                } else {
     2122                    log_msg(1, "I set ACL OK");
     2123                }
     2124                retval += res;
     2125            }
    21182126        }
    21192127        if (retval) {
     
    23032311        paranoid_system(command);
    23042312
    2305         iamhere("Restoring xattr, acl stuff");
    2306         res = set_fattr_list(filelist_subset_fname, xattr_fname);
    2307         if (res) {
    2308             log_msg(1, "Errors occurred while setting xattr");
    2309         } else {
    2310             log_msg(1, "I set xattr OK");
    2311         }
    2312         retval += res;
    2313 
    2314         res = set_acl_list(filelist_subset_fname, acl_fname);
    2315         if (res) {
    2316             log_msg(1, "Errors occurred while setting ACL");
    2317         } else {
    2318             log_msg(1, "I set ACL OK");
    2319         }
    2320         retval += res;
     2313        if (g_getfattr) {
     2314            iamhere("Restoring xattr stuff");
     2315            res = set_fattr_list(filelist_subset_fname, xattr_fname);
     2316            if (res) {
     2317                log_msg(1, "Errors occurred while setting xattr");
     2318            } else {
     2319                log_msg(1, "I set xattr OK");
     2320            }
     2321            retval += res;
     2322        }
     2323
     2324        if (g_getfacl) {
     2325            iamhere("Restoring acl stuff");
     2326            res = set_acl_list(filelist_subset_fname, acl_fname);
     2327            if (res) {
     2328                log_msg(1, "Errors occurred while setting ACL");
     2329            } else {
     2330                log_msg(1, "I set ACL OK");
     2331            }
     2332            retval += res;
     2333        }
    23212334
    23222335    } else {
     
    24592472    if (fbw) {
    24602473        fclose(fbw);
    2461         sprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2462         sprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2463         if (length_of_file(acl_fname) > 0) {
    2464             set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    2465         }
    2466         if (length_of_file(xattr_fname) > 0) {
    2467             set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
     2474        if (g_getfattr) {
     2475            sprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
     2476            if (length_of_file(xattr_fname) > 0) {
     2477                set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
     2478            }
     2479        }
     2480        if (g_getfacl) {
     2481            sprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
     2482            if (length_of_file(acl_fname) > 0) {
     2483                set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     2484            }
    24682485        }
    24692486    }
     
    26812698    total_slices = atol(tmp);
    26822699    sprintf(tmp, "Reassembling large files      ");
    2683     sprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
    2684     sprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2700    if (g_getfattr) {
     2701        sprintf(xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2702    }
     2703    if (g_getfacl) {
     2704        sprintf(acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2705    }
    26852706    mvaddstr_and_log_it(g_currentY, 0, tmp);
    26862707    sprintf(biggies_whose_EXATs_we_should_set,
     
    27592780        if (length_of_file(biggies_whose_EXATs_we_should_set) > 2) {
    27602781            iamhere("Setting biggie-EXATs");
    2761             if (length_of_file(acl_fname) > 0) {
    2762                 log_msg(1, "set_acl_list(%s,%s)",
    2763                         biggies_whose_EXATs_we_should_set, acl_fname);
    2764                 set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    2765             }
    2766             if (length_of_file(xattr_fname) > 0) {
    2767                 log_msg(1, "set_fattr_List(%s,%s)",
     2782            if (g_getfattr) {
     2783                if (length_of_file(xattr_fname) > 0) {
     2784                    log_msg(1, "set_fattr_List(%s,%s)",
    27682785                        biggies_whose_EXATs_we_should_set, xattr_fname);
    2769                 set_fattr_list(biggies_whose_EXATs_we_should_set,
     2786                    set_fattr_list(biggies_whose_EXATs_we_should_set,
    27702787                               xattr_fname);
     2788                }
     2789            }
     2790            if (g_getfacl) {
     2791                if (length_of_file(acl_fname) > 0) {
     2792                    log_msg(1, "set_acl_list(%s,%s)",
     2793                            biggies_whose_EXATs_we_should_set, acl_fname);
     2794                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     2795                }
    27712796            }
    27722797        } else {
     
    28702895    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
    28712896        update_progress_form(progress_str);
    2872         sprintf(xattr_fname, "%s/xattr-subset-%ld.tmp", bkpinfo->tmpdir,
     2897        if (g_getfattr) {
     2898            sprintf(xattr_fname, "%s/xattr-subset-%ld.tmp", bkpinfo->tmpdir,
    28732899                current_afioball_number);
    2874         sprintf(acl_fname, "%s/acl-subset-%ld.tmp", bkpinfo->tmpdir,
     2900            unlink(xattr_fname);
     2901        }
     2902        if (g_getfacl) {
     2903            sprintf(acl_fname, "%s/acl-subset-%ld.tmp", bkpinfo->tmpdir,
    28752904                current_afioball_number);
    2876         unlink(xattr_fname);
    2877         unlink(acl_fname);
     2905            unlink(acl_fname);
     2906        }
    28782907        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    28792908            iamhere("Reading EXAT files from tape");
     
    29142943        res =
    29152944            read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    2916         unlink(xattr_fname);
    2917         unlink(acl_fname);
     2945        if (g_getfattr) {
     2946            unlink(xattr_fname);
     2947        }
     2948        if (g_getfacl) {
     2949            unlink(acl_fname);
     2950        }
    29182951    }                           // next
    29192952    log_msg(1, "All done with afioballs");
Note: See TracChangeset for help on using the changeset viewer.