Ignore:
Timestamp:
Sep 29, 2013, 9:31:34 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • Finish with backports from 3.1 for now. Still some work to do, but we will now make that version compile and work again and serve as a base

so the gettext patch can be added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/mondorestore/mondo-rstr-compare.c

    r3185 r3193  
    4343
    4444  /** needs malloc *******/
    45     char *checksum_ptr;
    46     char *original_cksum_ptr;
    47     char *bigfile_fname_ptr;
    48     char *tmp_ptr = NULL;
    49     char *command_ptr;
    50 
    51     char *checksum, *original_cksum, *bigfile_fname, *tmp, *command;
     45    char *checksum = NULL;
     46    char *original_cksum = NULL;
     47    char *bigfile_fname = NULL;
     48    char *tmp = NULL;
     49    char *command = NULL;
    5250
    5351    char *p;
     
    5654
    5755    struct s_filename_and_lstat_info biggiestruct;
    58 
    59     malloc_string(checksum);
    60     malloc_string(original_cksum);
    61     malloc_string(bigfile_fname);
    62     malloc_string(tmp);
    63     malloc_string(command);
    64     malloc_string(checksum_ptr);
    65     malloc_string(original_cksum_ptr);
    66     malloc_string(bigfile_fname_ptr);
    67     malloc_string(command_ptr);
    6856
    6957  /*********************************************************************
     
    7159   *********************************************************************/
    7260    assert(bkpinfo != NULL);
    73     memset(checksum_ptr, '\0', sizeof(checksum));
    74     memset(original_cksum_ptr, '\0', sizeof(original_cksum));
    75     memset(bigfile_fname_ptr, '\0', sizeof(bigfile_fname));
    76     memset(command_ptr, '\0', sizeof(command));
    7761  /** end **/
    7862
     
    8165            insist_on_this_cd_number((++g_current_media_number));
    8266        } else {
    83             mr_asprintf(tmp_ptr, "No CD's left. No biggiefiles left. No prob, Bob.");
    84             log_msg(2, tmp_ptr);
    85             paranoid_free(tmp_ptr);
     67            log_msg(2, "No CD's left. No biggiefiles left. No prob, Bob.");
    8668            return (0);
    8769        }
    8870    }
    8971    if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) {
    90         mr_asprintf(tmp_ptr, "Cannot open bigfile %ld (%s)'s info file", bigfileno + 1, bigfile_fname_ptr);
    91         log_to_screen(tmp_ptr);
    92         paranoid_free(tmp_ptr);
     72        log_to_screen("Cannot open bigfile %ld (NULL)'s info file", bigfileno + 1);
    9373        return (1);
    9474    }
     
    9878    paranoid_fclose(fin);
    9979
    100     strcpy(checksum_ptr, biggiestruct.checksum);
    101     strcpy(bigfile_fname_ptr, biggiestruct.filename);
    102 
     80
     81    mr_asprintf(bigfile_fname, "%s", biggiestruct.filename);
    10382    log_msg(2, "biggiestruct.filename = %s", biggiestruct.filename);
     83    mr_asprintf(checksum, "%s", biggiestruct.checksum);
    10484    log_msg(2, "biggiestruct.checksum = %s", biggiestruct.checksum);
    10585
    10686    if (!g_text_mode) {
    107         mr_asprintf(tmp_ptr, "Comparing %s", bigfile_fname_ptr);
    108         newtDrawRootText(0, 22, tmp_ptr);
    109         paranoid_free(tmp_ptr);
     87        mr_asprintf(tmp, "Comparing %s", bigfile_fname);
     88        newtDrawRootText(0, 22, tmp);
     89        mr_free(tmp);
    11090        newtRefresh();
    11191    }
    112     if (!checksum[0]) {
    113         log_msg(2, "Warning - %s has no checksum", bigfile_fname_ptr);
    114     }
    115     if (!strncmp(bigfile_fname_ptr, "/dev/", 5)) {
    116         strcpy(original_cksum_ptr, "IGNORE");
    117     } else {
    118         sprintf(command_ptr,
    119                 "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors",
    120                 MNT_RESTORING, bigfile_fname_ptr);
    121     }
    122     log_msg(2, command_ptr);
    123     mr_asprintf(tmp_ptr, "cat /tmp/errors >> %s 2> /dev/null", MONDO_LOGFILE);
    124     paranoid_system(tmp_ptr);
    125     paranoid_free(tmp_ptr);
    126 
    127     if (system(command_ptr)) {
     92    if (checksum == NULL]) {
     93        log_msg(2, "Warning - %s has no checksum", bigfile_fname);
     94    }
     95    if (!strncmp(bigfile_fname, "/dev/", 5)) {
     96        log_msg(2, "IGNORING %s as begining with /dev", bigfile_fname);
     97        mr_free(checksum);
     98        mr_free(bigfile_fname);
     99        return (1);
     100    }
     101
     102    mr_asprintf(command, "md5sum \"%s%s\" > /tmp/md5sum.txt 2> /tmp/errors", MNT_RESTORING, bigfile_fname);
     103    log_msg(2, command);
     104    i =  system(command);
     105    mr_free(command);
     106
     107    mr_asprintf(tmp, "cat /tmp/errors >> %s 2> /dev/null", MONDO_LOGFILE);
     108    paranoid_system(tmp);
     109    mr_free(tmp);
     110
     111    if (i) {
    128112        log_OS_error("Warning - command failed");
    129         original_cksum[0] = '\0';
     113        mr_free(checksum);
     114        mr_free(bigfile_fname);
    130115        return (1);
    131116    } else {
    132117        if (!(fin = fopen("/tmp/md5sum.txt", "r"))) {
    133             log_msg(2,
    134                     "Unable to open /tmp/md5sum.txt; can't get live checksum");
    135             original_cksum[0] = '\0';
     118            log_msg(2, "Unable to open /tmp/md5sum.txt; can't get live checksum");
     119            mr_free(checksum);
     120            mr_free(bigfile_fname);
    136121            return (1);
    137122        } else {
    138             if (fgets(original_cksum_ptr, MAX_STR_LEN - 1, fin)) {
    139                 // FIXME
    140             }
     123            mr_getline(original_cksum, fin);
    141124            paranoid_fclose(fin);
    142             for (i = strlen(original_cksum_ptr);
     125            for (i = strlen(original_cksum);
    143126                 i > 0 && original_cksum[i - 1] < 32; i--);
    144127            original_cksum[i] = '\0';
    145             p = (char *) strchr(original_cksum_ptr, ' ');
     128            p = strchr(original_cksum, ' ');
    146129            if (p) {
    147130                *p = '\0';
     
    149132        }
    150133    }
    151     mr_asprintf(tmp_ptr, "bigfile #%ld ('%s') ", bigfileno + 1, bigfile_fname_ptr);
    152     if (!strcmp(checksum_ptr, original_cksum_ptr) != 0) {
    153         mr_strcat(tmp_ptr, " ... OK");
    154     } else {
    155         mr_strcat(tmp_ptr, "... changed");
     134    mr_asprintf(tmp, "bigfile #%ld ('%s') ", bigfileno + 1, bigfile_fname);
     135    if ((original_cksum != NULL) && (strcmp(checksum, original_cksum) == 0)) {
     136        mr_strcat(tmp, " ... OK");
     137    } else {
     138        mr_strcat(tmp, "... changed");
    156139        retval++;
    157140    }
    158     log_msg(1, tmp_ptr);
    159     paranoid_free(tmp_ptr);
     141    mr_free(checksum);
     142    mr_free(original_cksum);
     143
     144    log_msg(1, tmp);
     145    mr_free(tmp);
    160146
    161147    if (retval) {
     
    163149            fatal_error("Cannot openout changed.txt");
    164150        }
    165         fprintf(fout, "%s\n", bigfile_fname_ptr);
     151        fprintf(fout, "%s\n", bigfile_fname);
    166152        paranoid_fclose(fout);
    167153    }
    168 
    169     paranoid_free(original_cksum_ptr);
    170     paranoid_free(original_cksum);
    171     paranoid_free(bigfile_fname_ptr);
    172     paranoid_free(bigfile_fname);
    173     paranoid_free(checksum_ptr);
    174     paranoid_free(checksum);
    175     paranoid_free(command_ptr);
    176     paranoid_free(command);
    177     paranoid_free(tmp);
     154    mr_free(bigfile_fname);
    178155
    179156    return (retval);
     
    194171    int res;
    195172    long noof_biggiefiles, bigfileno = 0;
    196     char tmp[MAX_STR_LEN];
     173    char *tmp = NULL;
    197174
    198175    log_msg(1, "Comparing biggiefiles");
     
    215192                       noof_biggiefiles);
    216193    for (bigfileno = 0; bigfileno < noof_biggiefiles; bigfileno++) {
    217         sprintf(tmp, "Comparing big file #%ld", bigfileno + 1);
     194        mr_asprintf(tmp, "Comparing big file #%ld", bigfileno + 1);
    218195        log_msg(1, tmp);
    219196        update_progress_form(tmp);
     197        mr_free(tmp);
     198
    220199        res = compare_a_biggiefile(bigfileno);
    221200        retval += res;
     
    253232
    254233  /***  needs malloc *********/
    255     char *command, *tmp, *filelist_name, *logfile,
    256         *compressor_exe;
     234    char *command = NULL;
     235    char *tmp = NULL;
    257236    char *archiver_exe = NULL;
    258 
    259     malloc_string(command);
    260     malloc_string(tmp);
    261     malloc_string(filelist_name);
    262     malloc_string(logfile);
    263     malloc_string(compressor_exe);
     237    char *tmp1 = NULL;
     238    char *logfile = NULL;
     239    char *compressor_exe = NULL;
    264240
    265241    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
    266242    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    267     sprintf(logfile, "/tmp/afio.log.%d", current_tarball_number);
    268     sprintf(filelist_name, MNT_CDROM "/archives/filelist.%d",
    269             current_tarball_number);
     243    mr_asprintf(filelist_name, MNT_CDROM "/archives/filelist.%d", current_tarball_number);
    270244
    271245    if (strstr(tarball_fname, ".bz2")) {
    272         strcpy(compressor_exe, "bzip2");
     246        mr_asprintf(compressor_exe, "bzip2");
     247    } else if (strstr(tarball_fname, ".lzma")) {
     248        mr_asprintf(compressor_exe, "lzma");
    273249    } else if (strstr(tarball_fname, ".gz")) {
    274         strcpy(compressor_exe, "gzip");
     250        mr_asprintf(compressor_exe, "gzip");
    275251    } else if (strstr(tarball_fname, ".lzo")) {
    276         strcpy(compressor_exe, "lzop");
    277     } else {
    278         compressor_exe[0] = '\0';
     252        mr_asprintf(compressor_exe, "lzop");
    279253    }
    280254
     
    285259    }
    286260
    287     if (compressor_exe[0]) {
    288         strcpy(tmp, compressor_exe);
     261    if (compressor_exe) {
     262        mr_asprintf(tmp, "%s", compressor_exe);
    289263        if (!find_home_of_exe(tmp)) {
     264            mr_free(tmp);
     265            mr_free(compressor_exe);
     266            mr_free(archiver_exe);
    290267            fatal_error("(compare_a_tarball) Compression program missing");
    291268        }
    292         if (use_star)           // star
    293         {
     269        mr_free(tmp);
     270
     271        if (use_star) {
    294272            if (!strcmp(compressor_exe, "bzip2")) {
    295273                mr_strcat(archiver_exe, " -bz");
    296274            } else {
    297                 fatal_error
    298                     ("(compare_a_tarball) Please use only bzip2 with star");
     275                mr_free(compressor_exe);
     276                mr_free(archiver_exe);
     277                fatal_error("(compare_a_tarball) Please use only bzip2 with star");
    299278            }
    300         } else                  // afio
    301         {
    302             sprintf(compressor_exe, "-P %s -Z", tmp);
    303         }
    304     }
    305 // star -diff H=star -bz file=....
     279        } else {
     280            // afio
     281            mr_asprintf(tmp, "%s", compressor_exe);
     282            mr_free(compressor_exe);
     283            mr_asprintf(compressor_exe, "-P %s -Z", tmp);
     284            mr_free(tmp);
     285        }
     286    }
    306287
    307288#ifdef __FreeBSD__
     
    310291#define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE
    311292#endif
    312     if (use_star)               // doesn't use compressor_exe
    313     {
    314         sprintf(command,
    315                 "%s -sparse -diff H=exustar file=%s >> %s 2>> %s",
    316                 archiver_exe, tarball_fname, logfile, logfile);
    317     } else {
    318         sprintf(command,
    319                 "%s -r -b %ld -M 16m -c %ld %s %s >> %s 2>> %s",
    320                 archiver_exe,
    321                 TAPE_BLOCK_SIZE,
    322                 BUFSIZE, compressor_exe, tarball_fname, logfile, logfile);
    323     }
    324     paranoid_free(archiver_exe);
     293    mr_asprintf(logfile, "/tmp/afio.log.%d", current_tarball_number);
     294
     295    if (use_star) {
     296        // doesn't use compressor_exe
     297        mr_asprintf(command, "%s -sparse -diff H=exustar file=%s >> %s 2>> %s", archiver_exe, tarball_fname, logfile, logfile);
     298    } else {
     299        mr_asprintf(command, "%s -r -b %ld -M 16m -c %ld %s %s >> %s 2>> %s", archiver_exe, TAPE_BLOCK_SIZE, BUFSIZE, compressor_exe, tarball_fname, logfile, logfile);
     300    }
     301    mr_free(compressor_exe);
     302    mr_free(archiver_exe);
    325303
    326304#undef BUFSIZE
     
    330308    if (res) {
    331309        log_OS_error(command);
    332         sprintf(tmp, "Warning - afio returned error = %d", res);
    333         log_msg(2, tmp);
    334     }
     310        log_msg(2, "Warning - afio returned error = %d", res);
     311    }
     312    mr_free(command);
     313
    335314    if (length_of_file(logfile) > 5) {
    336         sprintf(command,
    337                 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MONDO_CACHE"/changed.txt",
    338                 logfile);
     315        mr_asprintf(command, "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MONDO_CACHE"/changed.txt", logfile);
    339316        paranoid_system(command);
     317        mr_free(command);
     318
    340319        archiver_errors = count_lines_in_file(logfile);
    341320    } else {
    342321        archiver_errors = 0;
    343322    }
    344     sprintf(tmp, "%ld difference%c in fileset #%d          ",
    345             archiver_errors, (archiver_errors != 1) ? 's' : ' ',
    346             current_tarball_number);
    347323    if (archiver_errors) {
    348         sprintf(tmp,
    349                 "Differences found while processing fileset #%d       ",
    350                 current_tarball_number);
    351         log_msg(1, tmp);
     324        log_msg(1, "%ld difference%c in fileset #%d          ", archiver_errors, (archiver_errors != 1) ? 's' : ' ', current_tarball_number);
    352325    }
    353326    unlink(logfile);
    354     paranoid_free(command);
    355     paranoid_free(tmp);
    356     paranoid_free(filelist_name);
    357     paranoid_free(logfile);
    358     paranoid_free(compressor_exe);
     327    mr_free(logfile);
     328
    359329    return (retval);
    360330}
     
    377347  /**  needs malloc **********/
    378348
    379     char *tarball_fname, *progress_str, *tmp;
     349    char *tarball_fname = NULL;
     350    char *progress_str = NULL;
     351    char *tmp = NULL;
    380352    char *mds = NULL;
    381353    long max_val;
    382354
    383     malloc_string(tarball_fname);
    384     malloc_string(progress_str);
    385355    malloc_string(tmp);
    386 
    387356    assert(bkpinfo != NULL);
    388357    mvaddstr_and_log_it(g_currentY, 0, "Comparing archives");
    389358    read_cfg_var(g_mondo_cfg_file, "last-filelist-number", tmp);
    390 
    391359    max_val = atol(tmp);
     360    paranoid_free(tmp);
     361
    392362    mds = media_descriptor_string(bkpinfo->backup_media_type);
    393     sprintf(progress_str, "Comparing with %s #%d ", mds, g_current_media_number);
     363    mr_asprintf(progress_str, "Comparing with %s #%d ", mds, g_current_media_number);
    394364
    395365    open_progress_form("Comparing files",
     
    403373        insist_on_this_cd_number(g_current_media_number);
    404374        update_progress_form(progress_str);
    405         sprintf(tarball_fname,
    406                 MNT_CDROM "/archives/%d.afio.bz2", current_tarball_number);
     375        mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.bz2", current_tarball_number);
    407376
    408377        if (!does_file_exist(tarball_fname)) {
    409             sprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.lzo",
    410                     current_tarball_number);
     378            mr_free(tarball_fname);
     379            mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.lzo", current_tarball_number);
    411380        }
    412381        if (!does_file_exist(tarball_fname)) {
    413             sprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.gz",
    414                     current_tarball_number);
     382            mr_free(tarball_fname);
     383            mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.lzma", current_tarball_number);
    415384        }
    416385        if (!does_file_exist(tarball_fname)) {
    417             sprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.",
    418                     current_tarball_number);
     386            mr_free(tarball_fname);
     387            mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.gz", current_tarball_number);
    419388        }
    420389        if (!does_file_exist(tarball_fname)) {
    421             sprintf(tarball_fname, MNT_CDROM "/archives/%d.star.bz2",
    422                     current_tarball_number);
     390            mr_free(tarball_fname);
     391            mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.afio.", current_tarball_number);
    423392        }
    424393        if (!does_file_exist(tarball_fname)) {
    425             sprintf(tarball_fname, MNT_CDROM "/archives/%d.star.",
    426                     current_tarball_number);
     394            mr_free(tarball_fname);
     395            mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.star.bz2", current_tarball_number);
     396        }
     397        if (!does_file_exist(tarball_fname)) {
     398            mr_free(tarball_fname);
     399            mr_asprintf(tarball_fname, MNT_CDROM "/archives/%d.star.", current_tarball_number);
    427400        }
    428401        if (!does_file_exist(tarball_fname)) {
     
    432405                == 0) {
    433406                log_msg(2, "OK, I think I'm done with tarballs...");
     407                mr_free(tarball_fname);
    434408                break;
    435409            }
    436410            log_msg(2, "OK, I think it's time for another CD...");
    437411            g_current_media_number++;
    438             sprintf(progress_str, "Comparing with %s #%d ", mds, g_current_media_number);
     412
     413            mr_free(progress_str);
     414            mr_asprintf(progress_str, "Comparing with %s #%d ", mds, g_current_media_number);
    439415            log_to_screen(progress_str);
    440416        } else {
     
    444420            current_tarball_number++;
    445421        }
    446     }
     422        mr_free(tarball_fname);
     423    }
     424    mr_free(progress_str);
    447425    mr_free(mds);
    448426
     
    453431        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    454432    }
    455     paranoid_free(tarball_fname);
    456     paranoid_free(progress_str);
    457     paranoid_free(tmp);
    458433    return (retval);
    459434}
     
    478453{
    479454  /** needs malloc *********/
    480     char *tmp, *cwd, *new, *command;
     455    char *tmp = NULL;
     456    char *cwd, *new;
     457    char *command = NULL;
    481458    int resA = 0;
    482459    int resB = 0;
     
    486463    malloc_string(cwd);
    487464    malloc_string(new);
    488     malloc_string(command);
    489465
    490466    assert(bkpinfo != NULL);
     
    509485    noof_changed_files = count_lines_in_file(MONDO_CACHE"/changed.txt");
    510486    if (noof_changed_files) {
    511         sprintf(tmp, "%ld files do not match the backup            ",
    512                 noof_changed_files);
    513         //      mvaddstr_and_log_it( g_currentY++, 0, tmp );
    514         log_to_screen(tmp);
    515         sprintf(command, "cat "MONDO_CACHE"/changed.txt >> %s", MONDO_LOGFILE);
     487        log_to_screen("%ld files do not match the backup            ", noof_changed_files);
     488
     489        mr_asprintf(command, "cat "MONDO_CACHE"/changed.txt >> %s", MONDO_LOGFILE);
    516490        paranoid_system(command);
    517     } else {
    518         sprintf(tmp, "All files match the backup                     ");
     491        mr_free(command);
     492    } else {
     493        mr_asprintf(tmp, "All files match the backup                     ");
    519494        mvaddstr_and_log_it(g_currentY++, 0, tmp);
    520495        log_to_screen(tmp);
    521     }
    522 
    523     paranoid_free(tmp);
     496        mr_free(tmp);
     497    }
     498
    524499    paranoid_free(cwd);
    525500    paranoid_free(new);
    526     paranoid_free(command);
    527501
    528502    return (resA + resB);
     
    552526    int res = 0;
    553527    long q;
    554     char *tmp;
     528    char *tmp = NULL;
    555529    char *new;
    556530    char *cwd;
    557531
    558     malloc_string(tmp);
    559532    malloc_string(new);
    560533    malloc_string(cwd);
     
    630603        } else {
    631604            q = count_lines_in_file(MONDO_CACHE"/changed.files");
    632             sprintf(tmp, "%ld significant difference%s found.", q,
    633                     (q != 1) ? "s" : "");
     605            mr_asprintf(tmp, "%ld significant difference%s found.", q, (q != 1) ? "s" : "");
    634606            mvaddstr_and_log_it(g_currentY++, 0, tmp);
    635607            log_to_screen(tmp);
    636 
    637             strcpy(tmp,
    638                   "Type 'less /tmp/changed.files' for a list of non-matching files");
     608            mr_free(tmp);
     609
     610            mr_asprintf(tmp, "Type 'less /tmp/changed.files' for a list of non-matching files");
    639611            mvaddstr_and_log_it(g_currentY++, 0, tmp);
    640612            log_to_screen(tmp);
     613            mr_free(tmp);
    641614
    642615            log_msg(2, "calling popup_changelist_from_file()");
     
    663636
    664637    kill_petris();
    665     paranoid_free(tmp);
    666638    paranoid_free(new);
    667639    paranoid_free(cwd);
     
    686658
    687659  /** needs malloc **/
    688     char *dir, *command;
     660    char *dir;
     661    char *command = NULL;
    689662
    690663    assert(bkpinfo != NULL);
    691664    malloc_string(dir);
    692     malloc_string(command);
    693665    if (getcwd(dir, MAX_STR_LEN)) {
    694666        // FIXME
     
    698670    }
    699671
    700     sprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp",
    701             bkpinfo->restore_path);
     672    mr_asprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp", bkpinfo->restore_path);
    702673    run_program_and_log_output(command, FALSE);
    703     mvaddstr_and_log_it(g_currentY,
    704                         0, "Verifying archives against filesystem");
     674    mr_free(command);
     675    mvaddstr_and_log_it(g_currentY, 0, "Verifying archives against filesystem");
    705676
    706677    if (bkpinfo->disaster_recovery
     
    726697    mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    727698    paranoid_free(dir);
    728     paranoid_free(command);
    729699    return (res);
    730700}
     
    749719{
    750720    int res;
    751     char *dir, *command;
     721    char *dir;
     722    char *command = NULL;
    752723
    753724    assert(bkpinfo != NULL);
    754725    malloc_string(dir);
    755     malloc_string(command);
    756726
    757727    if (getcwd(dir, MAX_STR_LEN)) {
     
    761731        // FIXME
    762732    }
    763     sprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp",
    764             bkpinfo->restore_path);
     733    mr_asprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp", bkpinfo->restore_path);
    765734    run_program_and_log_output(command, FALSE);
    766     mvaddstr_and_log_it(g_currentY,
    767                         0, "Verifying archives against filesystem");
     735    mr_free(command);
     736
     737    mvaddstr_and_log_it(g_currentY, 0, "Verifying archives against filesystem");
    768738    res = verify_tape_backups();
    769739    if (chdir(dir)) {
     
    776746    }
    777747    paranoid_free(dir);
    778     paranoid_free(command);
    779748    return (res);
    780749}
Note: See TracChangeset for help on using the changeset viewer.