Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/common/libmondo-tools.c

    r2937 r3147  
    304304{
    305305#ifdef __FreeBSD__
    306     system("kldstat | grep msdosfs || kldload msdosfs 2> /dev/null");
    307     system("kldstat | grep ext2fs  || kldload ext2fs 2> /dev/null");
     306    paranoid_system("kldstat | grep msdosfs || kldload msdosfs 2> /dev/null");
     307    paranoid_system("kldstat | grep ext2fs  || kldload ext2fs 2> /dev/null");
    308308#else
    309     system("modprobe -a msdos vfat loop &> /dev/null");
     309    paranoid_system("modprobe -a msdos vfat loop &> /dev/null");
    310310#endif
    311311}
     
    643643                colon++;
    644644                hent = gethostbyname(colon);
    645                 mr_asprintf(bkpinfo->netfs_user,"%s", hostname);
     645                mr_asprintf(&(bkpinfo->netfs_user),"%s", hostname);
    646646            } else {
    647647                hent = gethostbyname(hostname);
     
    713713}
    714714
     715/*  From busybox under GPLv2 */
     716#ifndef HAVE_MKDTEMP
     717/* This is now actually part of POSIX.1, but was only added in 2008 */
     718char* mkdtemp(char *template)
     719{
     720    if (mktemp(template) == NULL || mkdir(template, 0700) != 0)
     721        return NULL;
     722    return template;
     723}
     724#endif
     725
    715726void setup_tmpdir(char *path) {
    716727
     
    721732        /* purging a potential old tmpdir */
    722733        log_it("Purging old tmpdir %s", bkpinfo->tmpdir);
    723         chdir("/tmp");
     734        if (chdir("/tmp")) {
     735            // FIXME
     736        }
    724737        mr_asprintf(tmp,"rm -Rf %s",bkpinfo->tmpdir);
    725738        mr_free(bkpinfo->tmpdir);
    726         (void)system(tmp);
     739        paranoid_system(tmp);
    727740        mr_free(tmp);
    728741    }
     
    10321045    mr_free(tmp);
    10331046
    1034     if (!run_program_and_log_output("parted2fdisk -l | grep -i raid", 1)
     1047    if (!run_program_and_log_output("parted2fdisk -l 2>/dev/null | grep -i raid", 1)
    10351048        && !does_file_exist("/etc/raidtab")) {
    10361049        log_to_screen
    10371050            ("You have RAID partitions but no /etc/raidtab - creating one from /proc/mdstat");
    1038         create_raidtab_from_mdstat("/etc/raidtab");
     1051        create_raidtab_from_mdstat(MDSTAT_FILE,"/etc/raidtab");
    10391052    }
    10401053
Note: See TracChangeset for help on using the changeset viewer.