Changeset 127 for trunk


Ignore:
Timestamp:
Nov 19, 2005, 2:27:31 AM (14 years ago)
Author:
bcornec
Message:

merge -r 125:126 $SVN_M/branches/2.05

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/Mindi/DiskSize/lib/DiskSize.c

    r30 r127  
    44#include "DiskSize.h"
    55
    6 long
    7 get_size_of_disk(disk)
    8     const char *    disk;
     6long get_size_of_disk(disk)
     7const char *disk;
    98{
    10     int      fd;
    11     unsigned long ul;
    12     if ((fd = open (disk, O_RDONLY)) == -1) {
    13     return 0; /* couldn't open */
    14     }
    15     if (ioctl (fd, BLKGETSIZE, &ul) == -1) {
    16     return 0; /* couldn't ioctl */
    17     }
    18     close (fd);
    19     return ul / 2;
     9    int fd;
     10    unsigned long ul;
     11    if ((fd = open(disk, O_RDONLY)) == -1) {
     12        return 0;               /* couldn't open */
     13    }
     14    if (ioctl(fd, BLKGETSIZE, &ul) == -1) {
     15        return 0;               /* couldn't ioctl */
     16    }
     17    close(fd);
     18    return ul / 2;
    2019}
  • trunk/mindi/Mindi/DiskSize/lib/DiskSize.h

    r30 r127  
    1 extern long get_size_of_disk (const char *disk);
     1extern long get_size_of_disk(const char *disk);
  • trunk/mondo/mondo/common/libmondo-archive.c

    r89 r127  
    358358    paranoid_free(command);
    359359
    360     asprintf(&command, "cat %s | afio -o -b %ld -M 16m %s %s 2>> %s",
    361              filelist, TAPE_BLOCK_SIZE, zipparams, fname, MONDO_LOGFILE);
     360    asprintf(&command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s",
     361             TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE);
    362362    paranoid_free(zipparams);
    363363
     
    556556
    557557    asprintf(&tmp,
    558              "echo \"%s\" | tr -s ' ' '\n' | grep -x \"/dev/.*\" | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
     558             "echo '%s' | tr -s ' ' '\n' | grep -x '/dev/.*' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
    559559             bkpinfo->exclude_paths);
    560560    asprintf(&devs_to_exclude,
     
    8328326=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \
    83383311=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/
    834              "mindi --custom %s %s/images \"%s\" \"%s\" \
    835 \"%s\" %ld \"%s\" \"%s\" \"%s\" \
    836 \"%s\" %s %ld \"%s\" \"%s\" \"%s\" \"%s\" %ld %d %s", bkpinfo->tmpdir,  // parameter #2
     834             "mindi --custom %s %s/images '%s' '%s' \
     835'%s' %ld '%s' '%s' '%s' \
     836'%s' %s %ld '%s' '%s' '%s' '%s' %ld %d %s", bkpinfo->tmpdir,    // parameter #2
    837837             bkpinfo->scratchdir,   // parameter #3
    838838             bkpinfo->kernel_path,  // parameter #4
     
    917917    } else {
    918918        log_to_screen("Mindi failed to create your boot+data disks.");
    919         asprintf(&command, "cat %s | grep \"Fatal error\"",
    920                  "/var/log/mindi.log");
     919        asprintf(&command, "grep 'Fatal error' /var/log/mindi.log");
    921920        asprintf(&tmp, call_program_and_get_last_line_of_output(command));
    922921        paranoid_free(command);
     
    17151714                log_to_screen("%s...OK", message_to_screen);
    17161715                if (!run_program_and_log_output
    1717                     ("tail -n10 /var/log/mondo-archive.log | fgrep \":-(\"",
     1716                    ("tail -n10 /var/log/mondo-archive.log | fgrep ':-('",
    17181717                     1)) {
    17191718                    log_to_screen
     
    17241723#ifdef DVDRWFORMAT
    17251724            asprintf(&tmp,
    1726                      "cat %s | tail -n8 | grep \"blank=full.*dvd-compat.*DAO\"",
     1725                     "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'",
    17271726                     MONDO_LOGFILE);
    17281727            if (g_backup_media_type == dvd
     
    31053104    } else {
    31063105        file_to_openin = biggie_filename;
    3107         asprintf(&command, "md5sum \"%s\"", biggie_filename);
     3106        asprintf(&command, "md5sum '%s'", biggie_filename);
    31083107        if (!(fin = popen(command, "r"))) {
    31093108            log_OS_error("Unable to popen-in command");
     
    35083507        if (bkpinfo->verify_data && !res) {
    35093508            log_to_screen
    3510                 ("Please reboot from the 1st CD in Compare Mode, as a precaution.");
     3509                ("Please reboot from the 1st %s in Compare Mode, as a precaution.",
     3510                 media_descriptor_string(g_backup_media_type));
    35113511            chdir("/");
    35123512            iamhere("Before calling verify_cd_image()");
     
    36403640*/
    36413641        asprintf(&tmp,
    3642                  "cat %s | grep \"afio: \" | sed 's/afio: //' | grep -vx \"/dev/.*\" >> /tmp/changed.files",
     3642                 "sed -n -e 's/afio: //p' %s | grep -vx '/dev/.*' >> /tmp/changed.files",
    36433643                 MONDO_LOGFILE);
    36443644        system(tmp);
     
    36463646
    36473647        asprintf(&tmp,
    3648                  "cat %s | grep \"star: \" | sed 's/star: //' | grep -vx \"/dev/.*\" >> /tmp/changed.files",
     3648                 "sed -n -e 's/star: //p' %s | grep -vx '/dev/.*' >> /tmp/changed.files",
    36493649                 MONDO_LOGFILE);
    36503650        system(tmp);
  • trunk/mondo/mondo/common/libmondo-devices.c

    r122 r127  
    11/* libmondo-devices.c                 Subroutines for handling devices
    22   $Id$
    3 .
    4 
    5 
    6 01/07/2005
    7 - sensibly_set_tmpdir_and_scratchdir() --- exclude smb and smbfs and (new) cifs
    8 
    9 10/23
    10 - if root mounted at '/dev/rd/' then say FALSE, not mounted on ramdisk
    11   just to please Fred Beondo :-p
    12 
    13 07/25
    14 - updated get_phys_size_of_drive() to support newer, larger drives
    15 
    16 07/18
    17 - better support of users who boot from LVM CD and nuke-restore non-LVM backups
    18 
    19 07/08
    20 - BLKGETSIZE64 instead of BLKGETIO..whatever (Joshua)
    21 - amended to use BLKGETSIZE if BLKGETSIZE64 missing (Hugo)
    22 - resort to HDIO_GETGEO if BLKGETSIZE and BLKGETSIZE63 fail
    23 
    24 
    25 06/25
    26 - added Mandrake 9.2 support to which_boot_loader()
    27 - cleaned up find_cdrom_device()
    28 
    29 06/23
    30 - rewrote resolve_softlinks_to_get_to_actual_device_file() in C
    31 
    32 06/17
    33 - don't use star automatically if SELINUX detected; let user do that
    34 
    35 05/07
    36 - usage of parted2fdisk instead of fdisk alone (ia32/ia64 compatibility)
    37   BCO
    38 
    39 04/17
    40 - replaced INTERNAL_TAPE_BLK_SIZE with bkpinfo->internal_tape_block_size
    41 
    42 04/13
    43 - if kernel >= 2.6 then ask for /dev entry, not SCSI node
    44 
    45 04/12
    46 - in mount_CDROM_...whatever, don't use bkpinfo_DONTUSETHIS to see if
    47   mounting a real CD device; look for /dev/ at start of $device instead
    48 
    49 04/04
    50 - when testing for tape drive, use INTERNAL_TAPE_BLK_SIZE, not TAPE_BLOCK_SIZE
    51 
    52 04/03
    53 - don't eject/retract drive if ISO
    54 
    55 02/23/2004
    56 - changed strstr() to strncmp() in a few places
    57 
    58 12/11/2003
    59 - if we can't find the DVD using dvdrecord then try it w/cdrecord
    60 
    61 11/15
    62 - changed a few []s to char*s
    63 - better support of multiple CD-ROM drives
    64 
    65 11/14
    66 - better find_cdrom_device(), to cope w/ multiple CD writers
    67 
    68 10/26
    69 - call 'mt -f %s offline' to eject tape drive in eject_device()
    70 
    71 10/25
    72 - ask user to confirm which NFS share to mount
    73 - improved which_boot_loader()
    74 
    75 10/22
    76 - tweaked find_cdrom_device() and find_cdrw_device()
    77 - created find_dvd_device()
    78 
    79 10/21
    80 - changed "/mnt/cdrom" to MNT_CDROM
    81 
    82 09/28
    83 - interactive gui no longer asks dvd's speed
    84 
    85 09/26
    86 - interactive gui now supports dvd
    87 
    88 09/23
    89 - malloc/free global strings in new subroutines - malloc_libmondo_global_strings()
    90   and free_libmondo_global_strings() - which are in libmondo-tools.c
    91 
    92 09/21
    93 - ask for CD size when backing up interactively
    94 - offer to exclude NFS shares if they're present
    95 
    96 09/20
    97 - exclude /dev/shm from sensibly_*()
    98 
    99 09/18
    100 - less verbose logging when insisting on CD #n
    101 
    102 09/09
    103 - added resolve_softlinks_to_get_to_actual_device_file()
    104 
    105 09/05
    106 - rewrote inisist_on_this_cd_number() and what_number_cd_is_this()
    107 
    108 09/02
    109 - is_this_a_valid_disk_format() -- treat ntfs (a.k.a. type 7) as recognized format
    110   just in case user's backup includes a partimagehack-imaged drive
    111 
    112 08/01 - 08/31
    113 - better boot-time tape detection
    114 - remove backup-time, erroneous, "remove floppy" msg
    115 - working on am_I_in_disaster_recovery_mode()
    116 - interactively_obtain_...() - pause & ask user to remove CD/floppy
    117 
    118 06/01 - 07/31
    119 - in which_boot_loader(), also search /dev/cciss for boot loader
    120 - fixed calls to popup_and_get_string()
    121 - fixed bug in get_phys_size_of_drive()
    122 - fixed bug in where_is_root_mounted()
    123 - commented out a spurious assert()
    124 
    125 05/01 - 05/31
    126 - superior get_phys_size_of_drive() (Joshua Oreman)
    127 - fixed call to inject_device() --- Andree L.
    128 - find_cdrom_device() now may, if asked to, mount drive if possible,
    129   to test that it has a CD in it; it then unmounts
    130 - mount_CDROM_here() now calls retract_cd_and_defeat_autorun() as well
    131 - fixed support for subdir-within-NFS-mount
    132 - cleaned up some FreeBSD-specific stuff
    133 - added Joshua Oreman's FreeBSD patches
    134 - mount_CDROM_here() --- mkdir -p mountpt
    135 - add older drive support to get_phys_size_of_drive()
    136 
    137 04/01 - 04/30
    138 - made which_boot_loader() more friendly towards Red Hat 9
    139 - find_and_mount_actual_cd() retracts all CD trays
    140 - added lots of log_OS_error()'s and assert()'s
    141 - fix ISO support in interactively_restore_...()
    142 - made find_cdrom_device() skip dmesg if second-stage string is empty
    143 - in find_cdrw_device(), find cdrecord before dvdrecord
    144 - fixed am_i_in_disaster_recovery_mode()
    145 - fixed insist_on_this_cd_number()
    146 
    147 03/01 - 03/31
    148 - more work on find_cdrom_device()
    149 - find_cdrom_device() --- if nonexistent/not found then
    150   make sure to return '' as dev str and 1 as res
    151 - cleaner find_cdrom_device(), to find DVD instead of CD-ROM
    152   as last resort
    153 - fix insist_on_this_cd_number()
    154 - add user the speed of CD writer, if writing
    155 - if root is /dev/root then assume not a ramdisk
    156 
    157 01/07 - 02/28
    158 - fixed find_cdrom_device (Stan Benoit)
    159 - if root is at /dev/root/root then LVM (not ramdisk)
    160 - fix am_I_in_disaster_recovery_mode() to recognize that /dev/rd/cp*
    161   entries are not ramdisks but RAID disks
    162 - find_cdrw_device() no longer complains to stderr if no cdrecord
    163 
    164 01/02/2003
    165 - sensibly_set_tmpdir_and_scratchdir() --- exclude smb and smbfs
    166 
    167 12/01/2002
    168 - don't ask for isodir path if in disaster recovery mode
    169 
    170 11/01 - 11/30
    171 - added g_restoring_live_from_cd;
    172 - handle_incoming_parameters() will sensibly set tmpdir and scratchdir
    173 - properly wipe spurious scratchdir and tmpdir
    174 - modified sensibly_...() to use tmp.mondo.* and mondo.scratch.*
    175   instead of mondo.tmpdir.* and mondo.scratchdir.*
    176 - line 861,912: set media_size[0] to 1999 as well as 1 thru N
    177 - chmod 700, not 770, in make_fifo()
    178 - sensibly_set_tmpdir_and_scratchdir() will now prefix a '/' to the
    179   strings if it is missing
    180 
    181 10/01 - 10/31
    182 - changed find_cdrom_device() to ignore DVD drives in the hd[a-d] search;
    183   consequently, the subroutine will try scd0, sr0, etc. afterwards
    184 - commented code
    185 - fixed obscure bug in find_and_mount_actual_cd()
    186 - code which sensibly configures tmpdir,scratchdir is now sep. sub.
    187 - changed sort -s to sort -n <-- sensibly...()
    188 
    189 09/01 - 09/30
    190 - added list_of_NFS_devices_and_mounts()
    191 - try /dev/st0 if no tape specified at all
    192 - change '64k' to TAPE_BLOCK_SIZE
    193 - improved find_cdrom_device()
    194 - if cdrecord not found then find_cdrom_device() returns 1
    195 - if disaster recovery mode then don't ask for CD-ROM's /dev entry;
    196   assume /dev/cdrom
    197 - if restoring data then ask for CD-ROM's /dev entry (not its SCSI node)
    198 - run_program_and_log_output() now takes boolean operator to specify
    199   whether it will log its activities in the event of _success_
    200 - changed sort -n +4 to sort -s +4 (Troff)
    201 - ask if user's kernel is sane; if 'no' then use FAILSAFE
    202 - ask user to confirm the tape/CD device name
    203 - if restoring (not archiving) then don't try to find CD-ROM's SCSI
    204   node; try to find its /dev entry instead
    205 - better detection of biggest partition
    206 
    207 08/01 - 08/31
    208 - fixed verify bug --- CD#1 was being verified again & again & ...
    209 - detect boot loader + device; if not detectible then _ask_
    210 - if run interactively, assume tape size is irrelevant & don't ask
    211   for it; Mondo should handle end-of-tape gracefully now
    212 - worked on handling unknowng media size
    213 - added interactively_obtain_media_parameters_from_user()
    214 - when trying to mount CD-ROM, find_and_mount_actual_cd() will
    215   now call find_cdrom_device() to try to find the /dev entry first
    216 - fixed serious bug in zero_out_a_device()
    217 - cleaned up some log_it() calls
    218 - fixed minor bug in find_cdrom_device()
    219 - better at distinguishing between live filesystem and ramdisk
    220 
    221 07/24/2002
    222 - created
    2233*/
    2244
     
    21891969                if (!popup_and_get_string
    21901970                    ("ISO size.",
    2191                      "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s you plan to backup to.",
     1971                     "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to.",
    21921972                     sz_size, 16)) {
    21931973                    log_to_screen("User has chosen not to backup the PC");
  • trunk/mondo/mondo/common/libmondo-filelist.c

    r120 r127  
    158158    log_msg(1, "Sorting file %s", orig_fname);
    159159    asprintf(&tmp_fname, "/tmp/sort.%d.%d.%d", (int) (random() % 32768),
    160             (int) (random() % 32768), (int) (random() % 32768));
     160             (int) (random() % 32768), (int) (random() % 32768));
    161161
    162162    if (!does_file_exist(orig_fname)) {
     
    165165
    166166    asprintf(&command, "sort %s > %s 2>> %s", orig_fname, tmp_fname,
    167             MONDO_LOGFILE);
     167             MONDO_LOGFILE);
    168168    retval = system(command);
    169169    paranoid_free(command);
     
    254254    if (!(fbig = fopen(biggie_fname, "w"))) {
    255255        log_OS_error("Cannot openout biggie_fname");
    256         return(0);
     256        return (0);
    257257    }
    258258    if (!(fout = fopen(outfname, "w"))) {
    259259        log_OS_error("Cannot openout outfname");
    260         return(0);
     260        return (0);
    261261    }
    262262    (void) fgets(&incoming, &n, fin);
     
    268268        }
    269269        /* BERLIOS: Useless with getline
    270         if (i > MAX_STR_LEN - 1) {
    271             incoming[MAX_STR_LEN - 30] = '\0';
    272             log_msg(1, "Warning - truncating file %s's name", incoming);
    273             err++;
    274         }
    275         */
     270           if (i > MAX_STR_LEN - 1) {
     271           incoming[MAX_STR_LEN - 30] = '\0';
     272           log_msg(1, "Warning - truncating file %s's name", incoming);
     273           err++;
     274           }
     275         */
    276276        if (incoming[i] < 32) {
    277277            incoming[i] = '\0';
     
    298298                curr_set_no++;
    299299                curr_set_size = 0;
    300                 asprintf(&outfname, "%s/filelist.%ld", outdir, curr_set_no);
     300                asprintf(&outfname, "%s/filelist.%ld", outdir,
     301                         curr_set_no);
    301302                if (!(fout = fopen(outfname, "w"))) {
    302303                    log_OS_error("Unable to openout outfname");
    303                     return(0);
     304                    return (0);
    304305                }
    305306                update_evalcall_form((int) (lino * 100 / noof_lines));
     
    327328        log_OS_error
    328329            ("Unable to echo write one-liner to LAST-FILELIST-NUMBER");
    329         return(0);
     330        return (0);
    330331    }
    331332    paranoid_free(outfname);
     
    423424        return (2);
    424425    }
    425     for (getline(&tmp, &n, pattr); !feof(pattr);
    426          getline(&tmp, &n, pattr)) {
     426    for (getline(&tmp, &n, pattr); !feof(pattr); getline(&tmp, &n, pattr)) {
    427427        fputs(tmp, pout);
    428428    }
     
    490490//      sort_file(filelist); // FIXME - filelist chopper sorts, so this isn't necessary
    491491        asprintf(&command,
    492                 "cat %s | getfacl --all-effective -P - 2>> %s | gzip -c1 > %s 2>> %s",
    493                 filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE);
     492                 "cat %s | getfacl --all-effective -P - 2>> %s | gzip -c1 > %s 2>> %s",
     493                 filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE);
    494494        iamhere(command);
    495495        retval = system(command);
     
    544544{
    545545    const int my_depth = 8;
    546     char *command, *syscall_pin, *syscall_pout; 
     546    char *command, *syscall_pin, *syscall_pout;
    547547    char *incoming = NULL;
    548     char *current_subset_file = NULL; 
     548    char *current_subset_file = NULL;
    549549    char *current_master_file, *masklist;
    550550    int retval = 0;
     
    561561                "No masklist provided. I shall therefore set ALL attributes.");
    562562        asprintf(&command, "cat %s | gzip -dc | %s --restore - 2>> %s",
    563                 original_exat_fname, executable, MONDO_LOGFILE);
     563                 original_exat_fname, executable, MONDO_LOGFILE);
    564564        log_msg(1, "command = %s", command);
    565565        retval = system(command);
     
    575575    }
    576576    asprintf(&masklist, "/tmp/%d.%d.mask", (int) (random() % 32768),
    577             (int) (random() % 32768));
     577             (int) (random() % 32768));
    578578    asprintf(&command, "cp -f %s %s", orig_msklist, masklist);
    579579    run_program_and_log_output(command, 1);
     
    583583    asprintf(&syscall_pin, "cat %s | gzip -dc", original_exat_fname);
    584584    asprintf(&syscall_pout, "%s --restore - 2>> %s", executable,
    585             MONDO_LOGFILE);
     585             MONDO_LOGFILE);
    586586
    587587    log_msg(1, "syscall_pin = %s", syscall_pin);
     
    774774        return (add_string_at_node(node->right, string_to_add));
    775775    }
    776 
    777776    // walk down tree if appropriate
    778777    if (node->down != NULL && node->ch == char_to_add) {
     
    788787        return (1);
    789788    }
    790 
    791789    // add here
    792790    if (!(newnode = (struct s_node *) malloc(sizeof(struct s_node)))) {
     
    904902
    905903    open_evalcall_form("Loading filelist from disk");
    906     for (getline(&fname, &n, pin); !feof(pin);
    907          getline(&fname, &n, pin)) {
     904    for (getline(&fname, &n, pin); !feof(pin); getline(&fname, &n, pin)) {
    908905        if ((fname[strlen(fname) - 1] == 13
    909906             || fname[strlen(fname) - 1] == 10) && strlen(fname) > 0) {
     
    13261323 */
    13271324int open_and_list_dir(char *dir, char *sth, FILE * fout,
    1328                       time_t time_of_last_full_backup, char *skeleton_filelist)
     1325                      time_t time_of_last_full_backup,
     1326                      char *skeleton_filelist)
    13291327{
    13301328    DIR *dip;
     
    13591357        // 2.6 has /sys as a proc-type thing -- must be excluded
    13601358        asprintf(&tmp,
    1361                 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",
    1362                 dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1359                 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",
     1360                 dir, MAX_SKEL_DEPTH, skeleton_filelist);
    13631361#else
    13641362        // On BSD, for example, /sys is the kernel sources -- don't exclude
    13651363        asprintf(&tmp,
    1366                 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -type d -a -print > %s 2> /dev/null",
    1367                 dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1364                 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -type d -a -print > %s 2> /dev/null",
     1365                 dir, MAX_SKEL_DEPTH, skeleton_filelist);
    13681366#endif
    13691367        system(tmp);
     
    14361434            asprintf(&new_with_spaces, " %s ", new);
    14371435            /* BERLIOS: Old code
    1438             new_with_spaces[0] = ' ';
    1439             strcpy(new_with_spaces + 1, new);
    1440             strcat(new_with_spaces, " ");
    1441             */
     1436               new_with_spaces[0] = ' ';
     1437               strcpy(new_with_spaces + 1, new);
     1438               strcat(new_with_spaces, " ");
     1439             */
    14421440            if (strstr(skip_these, new_with_spaces)) {
    14431441                fprintf(fout, "%s\n", new);
     
    14471445                        && S_ISDIR(statbuf.st_mode)) {
    14481446                        open_and_list_dir(new, skip_these, fout,
    1449                                           time_of_last_full_backup, skeleton_filelist);
     1447                                          time_of_last_full_backup,
     1448                                          skeleton_filelist);
    14501449                    } else {
    14511450                        if (time_of_last_full_backup == 0
     
    14571456                                uberctr++;
    14581457                                asprintf(&tmp, " %c ",
    1459                                         special_dot_char(uberctr));
     1458                                         special_dot_char(uberctr));
    14601459#ifndef _XWIN
    14611460                                if (!g_text_mode) {
     
    15471546    time_t time_of_last_full_backup = 0;
    15481547    struct stat statbuf;
    1549     char *skeleton_filelist; 
    1550     // The pathname to the skeleton filelist, used to give better progress reporting for mondo_makefilelist().
     1548    char *skeleton_filelist;
     1549    // The pathname to the skeleton filelist, used to give better progress reporting for mondo_makefilelist().
    15511550
    15521551    asprintf(&sz_datefile, sz_datefile_wildcard, 0);
     
    15651564    if (differential == 0) {
    15661565        // restore last good datefile if it exists
    1567         asprintf(&command, "cp -f %s.aborted %s", sz_datefile, sz_datefile);
     1566        asprintf(&command, "cp -f %s.aborted %s", sz_datefile,
     1567                 sz_datefile);
    15681568        run_program_and_log_output(command, 3);
    15691569        paranoid_free(command);
     
    15721572        if (does_file_exist(sz_datefile)) {
    15731573            asprintf(&command, "mv -f %s %s.aborted", sz_datefile,
    1574                     sz_datefile);
     1574                     sz_datefile);
    15751575            paranoid_system(command);
    15761576            paranoid_free(command);
     
    16301630                log_msg(1, "Including %s in filelist %s", q, sz_filelist);
    16311631                open_and_list_dir(q, exclude_paths, fout,
    1632                                   time_of_last_full_backup, skeleton_filelist);
     1632                                  time_of_last_full_backup,
     1633                                  skeleton_filelist);
    16331634                p += strlen(q);
    16341635                while (*p == ' ') {
     
    18191820        return (1);
    18201821    }
    1821     for (getline(&tmp, &n, fin); !feof(fin);
    1822          getline(&tmp, &n, fin)) {
     1822    for (getline(&tmp, &n, fin); !feof(fin); getline(&tmp, &n, fin)) {
    18231823        if (!tmp[0]) {
    18241824            continue;
  • trunk/mondo/mondo/common/libmondo-files.c

    r110 r127  
    569569        return (output);
    570570    }
    571     sprintf(command, "cat %s | tail -n1", filename);
     571    sprintf(command, "tail -n1 %s", filename);
    572572    fin = popen(command, "r");
    573573    (void) fgets(output, MAX_STR_LEN, fin);
     
    13131313    if (scratchLL <= 1) {
    13141314        sprintf(tmp,
    1315                 "Your backup will probably occupy a single CD/tape/ISO. Maybe two.");
     1315                "Your backup will probably occupy a single %s. Maybe two.",
     1316                media_descriptor_string(bkpinfo->backup_media_type));
    13161317    } else {
    13171318        sprintf(tmp, "Your backup will occupy approximately %s media.",
  • trunk/mondo/mondo/common/libmondo-stream.c

    r122 r127  
    227227    }
    228228    asprintf(&command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l",
    229             cdr_exe);
     229             cdr_exe);
    230230    asprintf(&tmp, call_program_and_get_last_line_of_output(command));
    231231    paranoid_free(command);
     
    240240
    241241    asprintf(&command,
    242             "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1",
    243             cdr_exe);
     242             "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1",
     243             cdr_exe);
    244244    asprintf(&tmp, call_program_and_get_last_line_of_output(command));
    245245    paranoid_free(command);
     
    251251
    252252    asprintf(&command,
    253             "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1",
    254             cdr_exe);
     253             "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1",
     254             cdr_exe);
    255255    paranoid_free(cdr_exe);
    256256
     
    292292        log_it("Turning %s", dev);
    293293        paranoid_free(tmp);
    294         asprintf(&tmp, (strrchr(dev, '/') != NULL) ? strrchr(dev, '/') : dev);
     294        asprintf(&tmp,
     295                 (strrchr(dev, '/') != NULL) ? strrchr(dev, '/') : dev);
    295296        sprintf(dev, "/dev/os%s", tmp);
    296297        log_it("...into %s", dev);
     
    327328    int res = 0;
    328329    int retval = 0;
    329     char *fname = &res;     /* Should NOT be NULL */
     330    char *fname = &res;         /* Should NOT be NULL */
    330331
    331332// xattr
     
    411412        //      log_it("g_current_media_number = %d", g_current_media_number);
    412413        asprintf(&tmp,
    413                 "When the tape drive goes quiet, please insert volume %d in this series.",
    414                 tapeno);
     414                 "When the tape drive goes quiet, please insert volume %d in this series.",
     415                 tapeno);
    415416        popup_and_OK(tmp);
    416417        paranoid_free(tmp);
     
    467468    char *p;
    468469    /* BERLIOS: useless
    469     char suffix[16];
    470     */
     470       char suffix[16];
     471     */
    471472
    472473    bufsize_K = (long long) (1024LL * (1 + g_tape_buffer_size_MB));
    473474    asprintf(&tmpdir, "%s/tmpfs/backcatalog", td);
    474475    /* BERLIOS: useless
    475     if ((p = strrchr(latest_fname, '.'))) {
    476         strcpy(suffix, ++p);
    477     } else {
    478         suffix[0] = '\0';
    479     }
    480     */
     476       if ((p = strrchr(latest_fname, '.'))) {
     477       strcpy(suffix, ++p);
     478       } else {
     479       suffix[0] = '\0';
     480       }
     481     */
    481482    if (strstr(latest_fname, ".afio.") || strstr(latest_fname, ".star.")) {
    482483        type = fileset;
     
    556557        return (0);
    557558    }
    558     asprintf(&tmp, "mt -f %s setblk %ld", tapedev, internal_tape_block_size);
     559    asprintf(&tmp, "mt -f %s setblk %ld", tapedev,
     560             internal_tape_block_size);
    559561    res = run_program_and_log_output(tmp, 3);
    560562    paranoid_free(tmp);
     
    669671    chdir(bkpinfo->tmpdir);
    670672    asprintf(&tmp, "tar -zxf %s tmp/mondo-restore.cfg 2> /dev/null",
    671             outfname);
     673             outfname);
    672674    paranoid_system(tmp);
    673675    paranoid_free(tmp);
     
    696698    /*  add 'dummy' if testing */
    697699    asprintf(&command,
    698             "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s",
    699             cddev, speed, MONDO_LOGFILE, MONDO_LOGFILE);
     700             "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s",
     701             cddev, speed, MONDO_LOGFILE, MONDO_LOGFILE);
    700702    /*  initialise the catalog */
    701703    g_current_media_number = 1;
     
    817819    char *tmp;
    818820    char *datablock;
    819     char *temp_fname = bkpinfo;     /* Should NOT be NULL */
    820     char *temp_cksum = bkpinfo;     /* Should NOT be NULL */
     821    char *temp_fname = bkpinfo; /* Should NOT be NULL */
     822    char *temp_cksum = bkpinfo; /* Should NOT be NULL */
    821823    char *actual_cksum;
    822824
     
    857859    if (orig_size != temp_size && orig_size != -1) {
    858860        asprintf(&tmp,
    859                 "output file's size should be %ld K but is apparently %ld K",
    860                 (long) size >> 10, (long) temp_size >> 10);
     861                 "output file's size should be %ld K but is apparently %ld K",
     862                 (long) size >> 10, (long) temp_size >> 10);
    861863        log_to_screen(tmp);
    862864        paranoid_free(tmp);
     
    867869    }
    868870    asprintf(&tmp, "Reading file from tape; writing to '%s'; %ld KB",
    869             outfname, (long) size >> 10);
     871             outfname, (long) size >> 10);
    870872    log_to_screen(tmp);
    871873    paranoid_free(tmp);
     
    937939    if (strcmp(temp_cksum, actual_cksum)) {
    938940        asprintf(&tmp, "actual cksum=%s; recorded cksum=%s", actual_cksum,
    939                 temp_cksum);
     941                 temp_cksum);
    940942        log_to_screen(tmp);
    941943        paranoid_free(tmp);
    942944
    943945        asprintf(&tmp, "%s (%ld K) is corrupt on tape", temp_fname,
    944                 (long) orig_size >> 10);
     946                 (long) orig_size >> 10);
    945947        log_to_screen(tmp);
    946948        paranoid_free(tmp);
     
    11101112    int res;
    11111113    int ctrl_chr;
    1112     char *temp_fname = &res;        /* should NOT be NULL */
     1114    char *temp_fname = &res;    /* should NOT be NULL */
    11131115    char *datablock;
    11141116    long long temp_size, size;
     
    11751177            fread(datablock, 1, (size_t) TAPE_BLOCK_SIZE, g_tape_stream);
    11761178        }
    1177        
     1179
    11781180        paranoid_free(temp_fname);
    11791181        temp_fname = &res;
    1180         res =
    1181             read_header_block_from_stream(&temp_size, NULL,
    1182                                           &ctrl_chr);
     1182        res = read_header_block_from_stream(&temp_size, NULL, &ctrl_chr);
    11831183        if (ctrl_chr != BLK_STOP_FILE) {
    11841184            wrong_marker(BLK_STOP_FILE, ctrl_chr);
    11851185        }
    1186         res =
    1187             read_header_block_from_stream(&temp_size, NULL,
    1188                                           &ctrl_chr);
     1186        res = read_header_block_from_stream(&temp_size, NULL, &ctrl_chr);
    11891187        if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
    11901188            wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr);
    11911189        }
    1192         res =
    1193             read_header_block_from_stream(&temp_size, NULL,
    1194                                           &ctrl_chr);
     1190        res = read_header_block_from_stream(&temp_size, NULL, &ctrl_chr);
    11951191        if (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) {
    11961192            wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
     
    12091205        }
    12101206        /* BERLIOS: useless ?
    1211         pB = strrchr(the_file_I_was_reading, '/');
    1212         if (pB) {
    1213             pB++;
    1214         } else {
    1215             pB = the_file_I_was_reading;
    1216         }
    1217         */
     1207           pB = strrchr(the_file_I_was_reading, '/');
     1208           if (pB) {
     1209           pB++;
     1210           } else {
     1211           pB = the_file_I_was_reading;
     1212           }
     1213         */
    12181214    }
    12191215    log_msg(2, "Reading %s (it matches %s)", temp_fname,
     
    12911287    if (bkpinfo->backup_media_type == cdstream) {
    12921288        asprintf(&command,
    1293                 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s",
    1294                 bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE,
    1295                 MONDO_LOGFILE);
     1289                 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s",
     1290                 bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE,
     1291                 MONDO_LOGFILE);
    12961292        log_it("Opening OUT to next CD with the command");
    12971293        log_it(command);
     
    13431339    for (i = 0; i <= last; i++) {
    13441340        asprintf(&fname, "%s/tmpfs/backcatalog/%s", bkpinfo->tmpdir,
    1345                 g_tapecatalog->el[i].fname);
     1341                 g_tapecatalog->el[i].fname);
    13461342        if (!does_file_exist(fname)) {
    13471343            log_msg(6, "Can't write %s - it doesn't exist.", fname);
     
    14911487    }
    14921488    asprintf(&tmp, "Writing file '%s' to tape (%ld KB)", p,
    1493             (long) filesize >> 10);
     1489             (long) filesize >> 10);
    14941490    log_it(tmp);
    14951491    paranoid_free(tmp);
     
    15941590               g_tape_stream) / 1024;
    15951591    asprintf(&tmp, "%s (fname=%s, size=%ld K)",
    1596             marker_to_string(control_char), p,
    1597             (long) length_of_incoming_file >> 10);
     1592             marker_to_string(control_char), p,
     1593             (long) length_of_incoming_file >> 10);
    15981594    log_msg(6, tmp);
    15991595    paranoid_free(tmp);
     
    16151611    /*@ end vars *************************************************** */
    16161612    asprintf(&tmp, "Wrong marker! (Should be %s, is actually %s)",
    1617             marker_to_string(should_be), marker_to_string(it_is));
     1613             marker_to_string(should_be), marker_to_string(it_is));
    16181614    log_to_screen(tmp);
    16191615    paranoid_free(tmp);
  • trunk/mondo/mondo/common/libmondo-tools.c

    r94 r127  
    168168
    169169    asprintf(&tmp,
    170           "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \
     170            "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \
    171171file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \
    172172cat $file.old | awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
     
    189189
    190190    asprintf(&home_sz,
    191           call_program_and_get_last_line_of_output
    192           ("find /usr/lib/ /usr/local/ /usr/share/ /usr/local/share/ /opt/ /ramdisk/usr/share/ -type d -maxdepth 2 -name include -prune -o -type d -maxdepth 2 -path '*/mondo/restore-scripts' -printf '%h\n' 2> /dev/null"));
     191            call_program_and_get_last_line_of_output
     192            ("find /usr/lib/ /usr/local/ /usr/share/ /usr/local/share/ /opt/ /ramdisk/usr/share/ -type d -maxdepth 2 -name include -prune -o -type d -maxdepth 2 -path '*/mondo/restore-scripts' -printf '%h\n' 2> /dev/null"));
    193193
    194194    if (home_sz[0] == '\0') {
    195195        paranoid_free(home_sz);
    196196        asprintf(&home_sz,
    197               call_program_and_get_last_line_of_output
    198               ("find /usr -type d -path '*/mondo/restore-scripts' -follow -maxdepth 3 -printf '%h\n' 2> /dev/null"));
     197                call_program_and_get_last_line_of_output
     198                ("find /usr -type d -path '*/mondo/restore-scripts' -follow -maxdepth 3 -printf '%h\n' 2> /dev/null"));
    199199    }
    200200    if (home_sz[0] == '\0') {
     
    402402#ifdef __FreeBSD__
    403403    asprintf(&tmp,
    404           call_program_and_get_last_line_of_output
    405           ("vmstat | tail -1 | tr -s ' ' | cut -d' ' -f6"));
     404            call_program_and_get_last_line_of_output
     405            ("vmstat | tail -1 | tr -s ' ' | cut -d' ' -f6"));
    406406    avm += atol(tmp);
    407407    paranoid_free(tmp);
    408408    asprintf(&tmp,
    409           call_program_and_get_last_line_of_output
    410           ("swapinfo | grep -v Device | tr -s ' ' | cut -d' ' -f4 | tr '\n' '+' | sed 's/+$//' | bc"));
     409            call_program_and_get_last_line_of_output
     410            ("swapinfo | grep -v Device | tr -s ' ' | cut -d' ' -f4 | tr '\n' '+' | sed 's/+$//' | bc"));
    411411    avm += atol(tmp);
    412412    paranoid_free(tmp);
    413413    asprintf(&command, "mdmfs -s %d%c md9 %s", rdsiz_MB, 'm',
    414             g_tmpfs_mountpt);
     414             g_tmpfs_mountpt);
    415415#else
    416416    asprintf(&tmp,
    417           call_program_and_get_last_line_of_output
    418           ("free | grep \":\" | tr -s ' ' '\t' | cut -f2 | head -n1"));
     417            call_program_and_get_last_line_of_output
     418            ("free | grep \":\" | tr -s ' ' '\t' | cut -f2 | head -n1"));
    419419    avm += atol(tmp);
    420420    paranoid_free(tmp);
    421421    asprintf(&command, "mount /dev/shm -t tmpfs %s -o size=%d%c",
    422             g_tmpfs_mountpt, rdsiz_MB, 'm');
     422             g_tmpfs_mountpt, rdsiz_MB, 'm');
    423423    run_program_and_log_output("cat /proc/cpuinfo", 5);
    424424    /* BERLIOS: rpm is not necessarily there ! */
     
    453453
    454454    if (bkpinfo->backup_media_type == dvd) {
    455         if (! (find_home_of_exe("growisofs"))) {
     455        if (!(find_home_of_exe("growisofs"))) {
    456456            fatal_error("Please install growisofs.");
    457457        }
     
    483483            sprintf(bkpinfo->call_make_iso,
    484484                    "%s %s -Z %s . 2>> _ERR_",
    485                     mondo_mkisofs_sz,
    486                     "", bkpinfo->media_device);
     485                    mondo_mkisofs_sz, "", bkpinfo->media_device);
    487486        }
    488487        paranoid_free(mondo_mkisofs_sz);
     
    572571        log_it("isodir = %s", bkpinfo->isodir);
    573572        asprintf(&command, "df %s | tail -n1 | cut -d' ' -f1",
    574                 bkpinfo->isodir);
     573                 bkpinfo->isodir);
    575574        log_it("command = %s", command);
    576575        asprintf(&tmp, call_program_and_get_last_line_of_output(command));
     
    582581
    583582        asprintf(&command, "mount | grep -w %s | tail -n1 | cut -d' ' -f3",
    584                 tmp);
     583                 tmp);
    585584        paranoid_free(tmp);
    586585        log_it("command = %s", command);
     
    595594        log_it("isomnt: %s, %d", tmp, strlen(tmp));
    596595        if (strlen(bkpinfo->isodir) < strlen(tmp)) {
    597             asprintf(&iso_path,"");
     596            asprintf(&iso_path, "");
    598597        } else {
    599598            asprintf(&iso_path, "%s", bkpinfo->isodir + strlen(tmp));
     
    627626            } else {
    628627                asprintf(&ip_address, "%s%s", inet_ntoa((struct in_addr)
    629                                              *((struct in_addr *) hent->
    630                                                h_addr)), strchr(bkpinfo->nfs_mount, ':'));
     628                                                        *((struct in_addr
     629                                                           *) hent->
     630                                                          h_addr)),
     631                         strchr(bkpinfo->nfs_mount, ':'));
    631632                strcpy(bkpinfo->nfs_mount, ip_address);
    632633                paranoid_free(ip_address);
     
    789790
    790791    asprintf(&command, "df -m %s | tail -n1 | tr -s ' ' '\t' | cut -f4",
    791             partition);
     792             partition);
    792793    asprintf(&out_sz, call_program_and_get_last_line_of_output(command));
    793794    paranoid_free(command);
     
    836837    }
    837838    asprintf(&tmp,
    838           call_program_and_get_last_line_of_output
    839           ("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"));
     839            call_program_and_get_last_line_of_output
     840            ("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"));
    840841    if (atol(tmp) < 35000) {
    841842        retval++;
     
    926927        ("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5);
    927928    asprintf(&tmp,
    928           call_program_and_get_last_line_of_output
    929           ("mount | grep -E \"cdr(om|w)\""));
     929            call_program_and_get_last_line_of_output
     930            ("mount | grep -E \"cdr(om|w)\""));
    930931    if (strcmp("", tmp)) {
    931932        if (strstr(tmp, "autofs")) {
     
    10271028    if (!does_file_exist(config_file)) {
    10281029        asprintf(&tmp, "(read_cfg_var) Cannot find %s config file",
    1029                 config_file);
     1030                 config_file);
    10301031        log_to_screen(tmp);
    10311032        paranoid_free(tmp);
     
    10391040    } else {
    10401041        asprintf(&command, "cat %s | grep \"%s .*\" | cut -d' ' -f2,3,4,5",
    1041                 config_file, label);
     1042                 config_file, label);
    10421043        strcpy(value, call_program_and_get_last_line_of_output(command));
    10431044        paranoid_free(command);
     
    11501151        log_it("Started autofs OK");
    11511152    }
    1152         paranoid_free(tmp);
     1153    paranoid_free(tmp);
    11531154}
    11541155
     
    11681169    log_msg(4, "Done. Great. Seeting command to something");
    11691170    asprintf(&command,
    1170           "cat /etc/fstab | grep -v \":\" | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
     1171            "cat /etc/fstab | grep -v \":\" | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    11711172    log_msg(4, "Cool. Command = '%s'", command);
    11721173    asprintf(&tmp, call_program_and_get_last_line_of_output(command));
     
    11911192                asprintf(&g_boot_mountpt, tmp);
    11921193                asprintf(&tmp1,
    1193                         "%s (your /boot partition) is not mounted. I'll mount it before backing up",
    1194                         g_boot_mountpt);
     1194                         "%s (your /boot partition) is not mounted. I'll mount it before backing up",
     1195                         g_boot_mountpt);
    11951196                log_it(tmp1);
    11961197                paranoid_free(tmp1);
     
    12631264    if (!does_file_exist(config_file)) {
    12641265        asprintf(&tmp, "(write_cfg_file) Cannot find %s config file",
    1265                 config_file);
     1266                 config_file);
    12661267        log_to_screen(tmp);
    12671268        paranoid_free(tmp);
     
    12691270    }
    12701271    asprintf(&tempfile,
    1271           call_program_and_get_last_line_of_output
    1272           ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
     1272            call_program_and_get_last_line_of_output
     1273            ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
    12731274    if (does_file_exist(config_file)) {
    12741275        asprintf(&command, "cat %s | grep -vx \"%s .*\" > %s", config_file,
    1275                 label, tempfile);
     1276                 label, tempfile);
    12761277        paranoid_system(command);
    12771278        paranoid_free(command);
  • trunk/mondo/mondo/common/libmondo-verify.c

    r122 r127  
    608608    char *orig_cksum;
    609609    char *tmp;
    610     char *slice_fnam = (char *)&res;
     610    char *slice_fnam = (char *) &res;
    611611
    612612    /*@ pointers ******************************************************** */
     
    627627    asprintf(&test_file, "%s/temporary-%s", bkpinfo->tmpdir, p);
    628628    asprintf(&tmp,
    629     "Temporarily copying biggiefile %s's slices from tape to '%s'",
    630     p, test_file);
    631     log_it(tmp); 
     629             "Temporarily copying biggiefile %s's slices from tape to '%s'",
     630             p, test_file);
     631    log_it(tmp);
    632632    paranoid_free(tmp);
    633633    for (res =
     
    643643        unlink(test_file);
    644644        paranoid_free(slice_fnam);
    645         slice_fnam = (char *)&res;
     645        slice_fnam = (char *) &res;
    646646        res =
    647647            read_header_block_from_stream(&slice_siz, slice_fnam,
     
    654654        retval += res;
    655655        paranoid_free(slice_fnam);
    656         slice_fnam = (char *)&res;
     656        slice_fnam = (char *) &res;
    657657    }
    658658    paranoid_free(test_file);
     
    706706    /*@ buffers ***************************************************** */
    707707    char *tmp;
    708     char *fname = (char *)&res;             /* Should NOT be NULL */
     708    char *fname = (char *) &res;    /* Should NOT be NULL */
    709709    char *curr_xattr_list_fname;
    710710    char *curr_acl_list_fname;
     
    744744    for (res = read_header_block_from_stream(&size, fname, &ctrl_chr);
    745745         ctrl_chr != BLK_STOP_AFIOBALLS;
    746          res =
    747          read_header_block_from_stream(&size, fname, &ctrl_chr)) {
     746         res = read_header_block_from_stream(&size, fname, &ctrl_chr)) {
    748747        asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    749748                 bkpinfo->tmpdir, current_afioball_number);
     
    753752            iamhere("Reading EXAT files from tape");
    754753            paranoid_free(fname);
    755             fname = (char *)&res;
     754            fname = (char *) &res;
    756755            res =
    757756                read_EXAT_files_from_tape(bkpinfo, &size, fname, &ctrl_chr,
     
    781780        g_current_progress++;
    782781        paranoid_free(fname);
    783         fname = (char *)&res;
     782        fname = (char *) &res;
    784783        res = read_header_block_from_stream(&size, fname, &ctrl_chr);
    785784        if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
     
    787786        }
    788787        paranoid_free(fname);
    789         fname = (char *)&res;
     788        fname = (char *) &res;
    790789    }
    791790    log_msg(1, "All done with afioballs");
     
    817816
    818817    /*@ buffers ******************************************************** */
    819     char *orig_fname = (char *)&ctrl_chr;   /* Should NOT be NULL */
     818    char *orig_fname = (char *) &ctrl_chr;  /* Should NOT be NULL */
    820819    char *logical_fname;
    821820    char *comment;
     
    841840            iamhere("Grabbing the EXAT biggiefiles");
    842841            paranoid_free(orig_fname);
    843             orig_fname = (char *)&ctrl_chr;
     842            orig_fname = (char *) &ctrl_chr;
    844843            res =
    845844                read_EXAT_files_from_tape(bkpinfo, &size, orig_fname,
     
    851850    paranoid_free(curr_acl_list_fname);
    852851    paranoid_free(orig_fname);
    853     orig_fname = (char *)&ctrl_chr;
     852    orig_fname = (char *) &ctrl_chr;
    854853
    855854    if (ctrl_chr != BLK_START_BIGGIEFILES) {
     
    891890        g_current_progress++;
    892891        paranoid_free(orig_fname);
    893         orig_fname = (char *)&ctrl_chr;
     892        orig_fname = (char *) &ctrl_chr;
    894893    }
    895894    close_progress_form();
  • trunk/mondo/mondo/common/my-stuff.h

    r122 r127  
    210210 * @c growisofs command to generate a bootable DVD using isolinux, except for the directory to image.
    211211 */
    212 #define MONDO_GROWISOFS_REGULAR_SYSLINUX "growisofs -use-the-force-luke -J -no-emul-boot -boot-load-size 4 -b isolinux.bin --boot-info-table -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_ -v"
     212#define MONDO_GROWISOFS_REGULAR_SYSLINUX "growisofs -speed=1 -use-the-force-luke -J -no-emul-boot -boot-load-size 4 -b isolinux.bin --boot-info-table -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_ -v"
    213213
    214214/**
    215215 * @c growisofs command to generate a bootable DVD using LILO, except for the directory to image.
    216          */// -b images/mindi-boot.2880.img
    217 #define MONDO_GROWISOFS_REGULAR_ELILO     "growisofs -use-the-force-luke -no-emul-boot -b images/mindi-boot.2880.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
     216                 */// -b images/mindi-boot.2880.img
     217#define MONDO_GROWISOFS_REGULAR_ELILO     "growisofs -speed=1 -use-the-force-luke -no-emul-boot -b images/mindi-boot.2880.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
    218218
    219219/**
    220220 * @c growisofs command to generate a bootable DVD using LILO, except for the directory to image.
    221          */// -b images/mindi-boot.2880.img
    222 #define MONDO_GROWISOFS_REGULAR_LILO     "growisofs -no-emul-boot -b isolinux.bin -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
     221                 */// -b images/mindi-boot.2880.img
     222#define MONDO_GROWISOFS_REGULAR_LILO     "growisofs -speed=1 -no-emul-boot -b isolinux.bin -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
    223223
    224224/**
    225225 * @c growisofs command to generate a nonbootable DVD, except for the directory to image.
    226226 */
    227 #define MONDO_GROWISOFS_NONBOOT          "growisofs -use-the-force-luke -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
     227#define MONDO_GROWISOFS_NONBOOT          "growisofs -speed=1 -use-the-force-luke -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
    228228
    229229/**
  • trunk/mondo/mondo/common/newt-specific.c

    r121 r127  
    313313
    314314        system
    315             ("cat /var/log/mondo-archive.log | gzip -9 > /tmp/MA.log.gz 2> /dev/null");
     315            ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null");
    316316        if (!strstr(g_version, "cvs") && !strstr(g_version, "svn")) {
    317317            printf("Please try the latest SVN version ");
     
    427427        }
    428428        if (grep_for_me[0] != '\0') {
    429             asprintf(&command, "cat %s | grep \"%s\" | tail -n%d",
    430                      filename, grep_for_me, g_noof_log_lines);
    431         } else {
    432             asprintf(&command, "cat %s | tail -n%d", filename,
    433                      g_noof_log_lines);
     429            asprintf(&command, "grep '%s' %s | tail -n%d",
     430                     grep_for_me, filename, g_noof_log_lines);
     431        } else {
     432            asprintf(&command, "tail -n%d %s", g_noof_log_lines, filename);
    434433        }
    435434        fin = popen(command, "r");
  • trunk/mondo/mondo/mondorestore/mondo-prep.c

    r115 r127  
    488488            if (lvmversion == 2) {
    489489                strcpy(tmp, call_program_and_get_last_line_of_output
    490                        ("cat /var/log/mondo-archive.log | tail -n5 | grep Insufficient | tail -n1"));
     490                       ("tail -n5 /var/log/mondo-archive.log | grep Insufficient | tail -n1"));
    491491            } else {
    492492                strcpy(tmp, call_program_and_get_last_line_of_output
    493                        ("cat /var/log/mondo-archive.log | tail -n5 | grep lvcreate | tail -n1"));
     493                       ("tail -n5 /var/log/mondo-archive.log | grep lvcreate | tail -n1"));
    494494            }
    495495            for (p = tmp; *p != '\0' && !isdigit(*p); p++);
  • trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c

    r59 r127  
    23122312#else
    23132313
    2314     for (i = 0;
    2315          strcmp(raidlist->el[i].raid_device, device)
     2314    for (i = 0; strcmp(raidlist->el[i].raid_device, device)
    23162315         && i < raidlist->entries; i++);
    23172316#endif
     
    26252624 * @ingroup restoreUtilityGroup
    26262625 */
    2627 int
    2628 read_variableINT_and_remove_from_raidvars(struct
    2629                                           OSSWAP (raid_device_record,
    2630                                                   vinum_volume) * raidrec,
    2631                                           char *label)
     2626int read_variableINT_and_remove_from_raidvars(struct
     2627                                              OSSWAP (raid_device_record,
     2628                                                      vinum_volume) *
     2629                                              raidrec, char *label)
    26322630{
    26332631    /** int ***************************************************************/
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r94 r127  
    745745#endif
    746746
    747     } else
    748      if (bkpinfo->backup_media_type == iso) {
     747    } else if (bkpinfo->backup_media_type == iso) {
    749748#ifdef __FreeBSD__
    750749        sprintf(mount_cmd, "%s/%d.iso", bkpinfo->isodir,
     
    19651964    int signals[] =
    19661965        { SIGKILL, SIGPIPE, SIGTERM, SIGHUP, SIGTRAP, SIGABRT, SIGINT,
    1967 SIGSTOP, 0 };
     1966        SIGSTOP, 0
     1967    };
    19681968    int i;
    19691969    for (i = 0; signals[i]; i++) {
  • trunk/mondo/mondo/mondorestore/mr-externs.h

    r59 r127  
    8585extern void resize_drive_proportionately_to_suit_new_drives(struct
    8686                                                            mountlist_itself
    87                                                             *mountlist,
    88                                                             char
     87                                                            *mountlist, char
    8988                                                            *drive_name);
    9089extern void resize_mountlist_proportionately_to_suit_new_drives(struct
  • trunk/mondo/mondo/xmondo/xmondo.h

    r59 r127  
    5656  Q_OBJECT public:
    5757    /** construtor */
    58     XMondo(QWidget * parent = 0, const char *name = 0);
     58     XMondo(QWidget * parent = 0, const char *name = 0);
    5959    /** destructor */
    6060     virtual ~ XMondo();
  • trunk/mondo/mondo/xmondo/xmondobackup.h

    r59 r127  
    3030class XMondoBackup:public QObject {
    3131  Q_OBJECT public:
    32     XMondoBackup();
     32     XMondoBackup();
    3333    ~XMondoBackup();
    3434    int run(struct s_bkpinfo *bkpinfo);
  • trunk/mondo/mondo/xmondo/xmondorestore.h

    r59 r127  
    4444    bool good() {
    4545        return ok;
    46     } bool isSetupDone() {
     46    }
     47    bool isSetupDone() {
    4748        return doneSetup;
    4849    }
Note: See TracChangeset for help on using the changeset viewer.