Ignore:
Timestamp:
Feb 19, 2007, 1:51:26 AM (12 years ago)
Author:
bruno
Message:

Merges in trunk modifications coming from stable (common)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/src/common/libmondo-verify.c

    r1086 r1185  
    99#include "my-stuff.h"
    1010#include "mr_mem.h"
     11#include "mr_msg.h"
     12
    1113#include "mondostructures.h"
    1214#include "libmondo-verify.h"
     
    1820#include "libmondo-devices-EXT.h"
    1921#include "libmondo-tools-EXT.h"
    20 #include "mr_mem.h"
    2122
    2223/*@unused@*/
     
    5051{
    5152    /*@ buffer ********************************************************** */
    52     char *command;
    53     char *afio_found_changes;
     53    char *command = NULL;
     54    char *afio_found_changes = NULL;
    5455
    5556    /*@ int ************************************************************* */
     
    6667    sync();
    6768
    68 /*  s-printf (command,
    69        "grep \"afio: \" %s | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort -u | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s",
    70        stderr_fname, afio_found_changes);
    71 */
    7269
    7370    mr_msg(1, "Now scanning log file for 'afio: ' stuff");
     
    183180}
    184181
    185 
    186182/**
    187183 * Verify all slices stored on the inserted CD (or a mounted ISO image).
     
    197193{
    198194
     195    /*@ buffer ********************************************************** */
    199196    char *tmp = NULL;
    200197    char *tmp1 = NULL;
     
    235232            mr_asprintf(&sz_exe, "lzop");
    236233        } else if (bkpinfo->use_gzip) {
    237             strcpy(sz_exe, "gzip");
    238         } else if (bkpinfo->use_gzip) {
    239             strcpy(sz_exe, "gzip");
     234            mr_asprintf(&sz_exe, "gzip");
    240235        } else {
    241236            mr_asprintf(&sz_exe, "bzip2");
    242237        }
    243238    } else {
    244         mr_asprintf(&sz_exe, " ");
     239        mr_asprintf(&sz_exe, "");
    245240    }
    246241
     
    381376{
    382377    /*@ buffers ********************************************************* */
    383     char *command;
    384     char *outlog;
     378    char *command = NULL;
     379    char *outlog = NULL;
    385380    char *tmp = NULL;
    386     //  char *p;
    387381
    388382    /*@ pointers ******************************************************* */
    389     FILE *pin;
     383    FILE *pin = NULL;
    390384
    391385    size_t n = 0;
     
    399393    log_it("Verifying fileset '%s'", tarball_fname);
    400394
    401     /*  chdir("/"); */
    402395    mr_asprintf(&outlog, "%s/afio.log", bkpinfo->tmpdir);
    403396
     
    430423    if (strstr(tarball_fname, ".star")) {
    431424        bkpinfo->use_star = TRUE;
    432         if (strstr(tarball_fname, ".bz2"))
     425        if (strstr(tarball_fname, ".bz2")) {
    433426            mr_asprintf(&command,
    434427                     "star -diff diffopts=mode,size,data file=%s %s >> %s 2>> %s",
     
    436429                     (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog,
    437430                     outlog);
     431        } else {
     432            mr_asprintf(&command,"");
     433        }
    438434    } else {
    439435        bkpinfo->use_star = FALSE;
     
    446442
    447443    if (length_of_file(outlog) < 10) {
     444        /* BERLIOS: This seems useless !! */
    448445        mr_asprintf(&command, "cat %s >> %s", outlog, MONDO_LOGFILE);
    449446    } else {
     
    488485    mr_free(command);
    489486
    490     /*  chdir(old_pwd); */
    491     //  s-printf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);
    492     //  paranoid_system (tmp);
    493     //  unlink ("/tmp/mondo-verify.err");
    494487    return (0);
    495488}
     
    543536
    544537    /*@ buffers ********************************************************** */
    545     char *tmp;
    546     char *tarball_fname;
     538    char *tmp = NULL;
     539    char *tarball_fname = NULL;
    547540
    548541    /*@ pointers ********************************************************* */
    549     char *p;
     542    char *p = NULL;
    550543
    551544    assert(bkpinfo != NULL);
     
    563556
    564557    mr_asprintf(&tarball_fname, "%s/tmpfs/temporary-%s", bkpinfo->tmpdir, p);
    565     /* BERLIOS : useless
    566        mr_asprintf(&tmp, "Temporarily copying file from tape to '%s'",
    567        tarball_fname);
    568        log_it(tmp);
    569        mr_free(tmp);
    570      */
    571558    read_file_from_stream_to_file(bkpinfo, tarball_fname, size);
    572559    res = verify_a_tarball(bkpinfo, tarball_fname);
    573560    if (res) {
    574         mr_asprintf(&tmp,
    575                  "Afioball '%s' no longer matches your live filesystem",
    576                  p);
    577         mr_msg(0, tmp);
    578         mr_free(tmp);
     561        mr_msg(0, "Afioball '%s' no longer matches your live filesystem", p);
    579562        retval++;
    580563    }
     
    604587
    605588    /*@ char ************************************************************ */
    606     char *test_file;
    607     char *biggie_cksum;
    608     char *orig_cksum;
    609     char *tmp;
     589    char *test_file = NULL;
     590    char *biggie_cksum = NULL;
     591    char *orig_cksum = NULL;
     592    char *tmp = NULL;
    610593    char *slice_fnam = (char *) &res;
    611594
     
    626609    }
    627610    mr_asprintf(&test_file, "%s/temporary-%s", bkpinfo->tmpdir, p);
    628     mr_asprintf(&tmp,
    629              "Temporarily copying biggiefile %s's slices from tape to '%s'",
    630              p, test_file);
    631     log_it(tmp);
    632     mr_free(tmp);
    633611    for (res =
    634612         read_header_block_from_stream(&slice_siz, slice_fnam, &ctrl_chr);
     
    704682
    705683    /*@ buffers ***************************************************** */
    706     char *tmp;
     684    char *tmp = NULL;
    707685    char *fname = (char *) &res;    /* Should NOT be NULL */
    708     char *curr_xattr_list_fname;
    709     char *curr_acl_list_fname;
     686    char *curr_xattr_list_fname = NULL;
     687    char *curr_acl_list_fname = NULL;
    710688
    711689    /*@ long long *************************************************** */
     
    772750        }
    773751        mr_asprintf(&tmp, "Verifying fileset #%ld", current_afioball_number);
    774         /*log_it(tmp); */
    775752        update_progress_form(tmp);
    776753        mr_free(tmp);
     
    824801    /*@ buffers ******************************************************** */
    825802    char *orig_fname = (char *) &ctrl_chr;  /* Should NOT be NULL */
    826     char *logical_fname;
    827     char *comment;
    828     char *curr_xattr_list_fname;
    829     char *curr_acl_list_fname;
     803    char *logical_fname = NULL;
     804    char *comment = NULL;
     805    char *curr_xattr_list_fname = NULL;
     806    char *curr_acl_list_fname = NULL;
    830807    /*@ pointers ******************************************************* */
    831     char *p;
     808    char *p = NULL;
    832809
    833810    /*@ long long size ************************************************* */
     
    931908
    932909    /*@ buffers ******************************************************** */
    933     char *mountpoint;
    934     char *command;
    935     char *tmp;
    936     char *fname;
     910    char *mountpoint = NULL;
     911    char *command = NULL;
     912    char *tmp = NULL;
     913    char *fname = NULL;
    937914#ifdef __FreeBSD__
    938915    char mdd[32];
     
    991968            log_to_screen(tmp);
    992969            mr_free(tmp);
     970            mr_free(command);
    993971            return (1);
    994972        }
     
    1014992    verify_all_slices_on_CD(bkpinfo, mountpoint);
    1015993
     994    mr_asprintf(&command, "umount %s", mountpoint);
    1016995#ifdef __FreeBSD__
    1017996    ret = 0;
    1018     mr_asprintf(&command, "umount %s", mountpoint);
    1019997    ret += system(command);
    1020 
    1021998    ret += kick_vn(mddevice);
    1022999    if (ret)
    10231000#else
    1024     mr_asprintf(&command, "umount %s", mountpoint);
    1025 
    10261001    if (system(command))
    10271002#endif
     
    10671042
    10681043    /*@ buffers ******************************************************** */
    1069     char *tmp;
    1070     char *changed_files_fname;
     1044    char *tmp = NULL;
     1045    char *changed_files_fname = NULL;
    10711046
    10721047    /*@ long *********************************************************** */
     
    10891064
    10901065    /* close tape; exit */
    1091     //  fclose(g_tape_stream); <-- not needed; is handled by closein_tape()
    10921066    paranoid_system
    10931067        ("rm -f /tmp/biggies.changed /tmp/changed.files.[0-9]* 2> /dev/null");
Note: See TracChangeset for help on using the changeset viewer.