Ignore:
Timestamp:
Jun 3, 2009, 7:10:19 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3089@localhost: bruno | 2009-05-18 06:41:05 +0200

  • move call to asprintf to call to mr_asprintf (suppress a compiler warning)
  • remove all the most obvious bad call to strcat and replace by mr_strcat as appropriate
File:
1 edited

Legend:

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

    r1747 r2211  
    11/***************************************************************************
    2 libmondo-verify.c  -  description
    3 -----------------
    4 
    5 begin: Fri Apr 19 16:40:35 EDT 2002
    6 copyright : (C) 2002 Mondo  Hugo Rabson
    7 email     : Hugo Rabson <hugorabson@msn.com>
    8 edited by : by Stan Benoit 4/2002
    9 email     : troff@nakedsoul.org
    10 cvsid     : $Id$
     2$Id$
    113***************************************************************************/
    12 
    13 /***************************************************************************
    14  *                                                                         *
    15  *   This program is free software; you can redistribute it and/or modify  *
    16  *   it under the terms of the GNU General Public License as published by  *
    17  *   the Free Software Foundation; either version 2 of the License, or     *
    18  *   (at your option) any later version.                                   *
    19  *                                                                         *
    20  ***************************************************************************/
    21 /* mondo-verify
    22 
    23 
    24 07/07
    25 - added star verify support
    26 
    27 04/04/2004
    28 - added star support
    29 
    30 10/23/2003
    31 - changed "ISO #n" to "<media descriptor> #n"
    32 
    33 10/01
    34 - working on biggiefile verification (CDs)
    35 
    36 09/16
    37 - fixed bug in CD biggie verif'n
    38 
    39 09/15
    40 - state explicitly that we do not verify disk images
    41 
    42 09/13
    43 - working on verify_all_slices_on_CD()
    44 
    45 09/01
    46 - write list of changed biggiefiles (streaming only) to changed.files
    47 
    48 05/05
    49 - exclude /dev/ * from list of changed files
    50 - add Joshua Oreman's FreeBSD patches
    51 
    52 04/24/2003
    53 - added lots of assert()'s and log_OS_error()'s
    54 
    55 09/01 - 09/30/2002
    56 - run_program_and_log_output() now takes boolean operator to specify
    57   whether it will log its activities in the event of _success_
    58 - eject_device() added
    59 - cleaned up 'changed file' feedback a little bit
    60 
    61 08/01 - 08/31
    62 - make sure to prefix bkpinfo->restore_path to local biggiefile fname when
    63   comparing it to the archived copy of biggiefile; otherwise, biggiefile
    64   not found & checksum missing & so on
    65 - exclude "incheckentry xwait()" from changed.files
    66 - cleaned up some log_it() calls
    67 
    68 07/01 - 07/31
    69 - renamed libmondo-verify.c
    70 - say 'bigfile' not 'biggiefile'
    71 - exclude /dev/ * from changed.files
    72 
    73 01/01 - 06/30
    74 - remove /tmp/changed.files.* dead files
    75 - don't pclose() tape after calling closein_tape(): the latter does it already
    76 - fixed bug in verify_cd_image()'s CD-mounting code
    77 - don't write to screen "old cksum.. curr cksum.."
    78 - changed the gawks to awks for the benefit of Debian
    79 - handles files >2GB in size
    80 - fixed bug in /tmp/changed.files-generator
    81 - re-enabled a lot of CD-verification code
    82 - afioballs are saved in %s/tmpfs/ now (%s=tmpdir)
    83 - changed some labels to make them more user-friendly
    84 - don't chdir() anywhere before verifying stuff
    85 - changed files are now detected by verify_tape_backup() and listed in
    86   /tmp/changed.files
    87 - replaced &> with > .. 2>
    88 - still implementing improved tape support
    89 
    90 
    91 Started late Dec, 2001
    92 
    93 -----------------------------------------------------------------------------
    94 */
    954
    965
     
    10110
    10211#include "my-stuff.h"
     12#include "mr_mem.h"
    10313#include "mondostructures.h"
    10414#include "libmondo-verify.h"
     
    419329                            bkpinfo->restore_path,
    420330                            biggiestruct.filename);
    421                 asprintf(&tmp, "echo \"%s/%s not found\" >> %s/biggies.changed",
     331                mr_asprintf(&tmp, "echo \"%s/%s not found\" >> %s/biggies.changed",
    422332                            bkpinfo->restore_path,
    423333                            biggiestruct.filename,
     
    1070980    assert(bkpinfo != NULL);
    1071981
    1072     asprintf(&fname, "%s1", bkpinfo->media_device);
     982    mr_asprintf(&fname, "%s1", bkpinfo->media_device);
    1073983    if (is_this_device_mounted(fname)) {
    1074984        log_msg(1, "USB device mounted. Remounting it at the right place");
    1075         asprintf(&tmp, "umount %s", fname);
     985        mr_asprintf(&tmp, "umount %s", fname);
    1076986        run_program_and_log_output(tmp, FALSE);
    1077987        paranoid_free(tmp);
     
    1080990
    1081991    log_msg(1, "Mounting USB device.");
    1082     asprintf(&mountpoint, "%s/usb", bkpinfo->tmpdir);
    1083     asprintf(&tmp, "mkdir -p %s", mountpoint);
     992    mr_asprintf(&mountpoint, "%s/usb", bkpinfo->tmpdir);
     993    mr_asprintf(&tmp, "mkdir -p %s", mountpoint);
    1084994    run_program_and_log_output(tmp, FALSE);
    1085995    paranoid_free(tmp);
    1086996    /* Mindi always create one single parition on the USB dev */
    1087     asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, mountpoint);
     997    mr_asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, mountpoint);
    1088998    ret = run_program_and_log_output(tmp, FALSE);
    1089999    paranoid_free(tmp);
     
    10951005    sync();
    10961006    log_msg(2, "OK, I've mounted the USB Disk/Key\n");
    1097     asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint);
     1007    mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint);
    10981008    if (!does_file_exist(tmp)) {
    10991009        log_msg
     
    11121022    verify_all_slices_on_CD(mountpoint);
    11131023
    1114     asprintf(&tmp1, "umount %s", mountpoint);
     1024    mr_asprintf(&tmp1, "umount %s", mountpoint);
    11151025#ifdef __FreeBSD__
    11161026    ret += system(tmp1);
     
    11211031#endif
    11221032    {
    1123         asprintf(&tmp, "%s failed; unable to unmount USB device\n", tmp1);
     1033        mr_asprintf(&tmp, "%s failed; unable to unmount USB device\n", tmp1);
    11241034        log_to_screen(tmp);
    11251035        paranoid_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.