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.
File:
1 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)) {
Note: See TracChangeset for help on using the changeset viewer.