Changeset 2907 in MondoRescue for branches/3.0


Ignore:
Timestamp:
Nov 29, 2011, 2:58:39 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Should fix #512 by clearing old scratchdir before changing to a new
Location:
branches/3.0
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/mindi

    r2906 r2907  
    10261026
    10271027MakeMountlist() {
    1028     local scratchdir mountlist all_partitions current_partition \
     1028    local mountlist all_partitions current_partition \
    10291029partition_size partition_format outstring partition_number \
    10301030partition_mountpt c_p lwm_info psz lvm_dev unofficial_outstring \
     
    10371037    echo "-----------------------------------" >> $LOGFILE
    10381038
    1039 # scratchdir, mountlist(OUT)
    1040     scratchdir=$MINDI_TMP
     1039# mountlist(OUT)
    10411040    mountlist=$1
    10421041
  • branches/3.0/mondo/src/common/libmondo-archive.c

    r2881 r2907  
    15821582    log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir);
    15831583    (void) getcwd(old_pwd, MAX_STR_LEN - 1);
    1584     mr_asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir);
     1584    mr_asprintf(&tmp, "chmod 700 %s", bkpinfo->scratchdir);
    15851585    run_program_and_log_output(tmp, FALSE);
    15861586    paranoid_free(tmp);
     
    17191719            bkpinfo->scratchdir, destfile);
    17201720    (void) getcwd(old_pwd, MAX_STR_LEN - 1);
    1721     sprintf(tmp, "chmod 744 %s", bkpinfo->scratchdir);
     1721    sprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir);
    17221722    run_program_and_log_output(tmp, FALSE);
    17231723    chdir(bkpinfo->scratchdir);
  • branches/3.0/mondo/src/common/libmondo-cli.c

    r2877 r2907  
    106106    }
    107107//    }
     108    /*  Before erasing dirs go into a safe place */
     109    chdir("/tmp");
    108110    sprintf(tmp, "rm -Rf %s/tmp.mondo.*", bkpinfo->tmpdir);
    109111    paranoid_system(tmp);
     
    808810
    809811    if (flag_set['S']) {
     812        /* Before changing remove old ones if any */
     813        if (bkpinfo->scratchdir) {
     814            chdir("/tmp");
     815            mr_asprintf(&tmp, "rm -Rf %s", bkpinfo->scratchdir);
     816            paranoid_system(tmp);
     817            mr_free(tmp);
     818        }
    810819        sprintf(bkpinfo->scratchdir, "%s/mondo.scratch.%ld", flag_val['S'],
    811820                random() % 32768);
  • branches/3.0/mondo/src/common/libmondo-devices.c

    r2878 r2907  
    29732973    log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir);
    29742974
     2975    /* Before changing remove old ones if any */
     2976    if (bkpinfo->scratchdir) {
     2977        chdir("/tmp");
     2978        mr_asprintf(&tmp, "rm -Rf %s", bkpinfo->scratchdir);
     2979        paranoid_system(tmp);
     2980        mr_free(tmp);
     2981    }
    29752982    sprintf(bkpinfo->scratchdir, "%s/mondo.scratch.%d", tmp,
    29762983            (int) (random() % 32768));
  • branches/3.0/mondo/src/common/libmondo-tools.c

    r2848 r2907  
    733733        /* purging a potential old tmpdir */
    734734        log_it("Purging old tmpdir %s", bkpinfo->tmpdir);
     735        chdir("/tmp");
    735736        mr_asprintf(&tmp,"rm -Rf %s",bkpinfo->tmpdir);
    736737        (void)system(tmp);
  • branches/3.0/mondo/src/common/newt-specific.c

    r2901 r2907  
    405405        /* newtPopHelpLine(); */
    406406
    407         chdir("/");
     407        /*  Before removing dir, make sure we're out of them */ */
     408        chdir("/tmp");
    408409        run_program_and_log_output("umount -d " MNT_CDROM, FALSE);
    409410        if (g_selfmounted_isodir) {
     
    429430            log_msg(8,"tempdir is %s",bkpinfo->tmpdir);
    430431            if (strstr(bkpinfo->tmpdir ,"mondo.tmp.") != NULL) {
    431                 log_msg(8,"erasing tempdir");
     432                log_msg(8,"erasing tempdir %s",bkpinfo->tmpdir);
    432433                mr_asprintf(&command, "rm -Rf %s", bkpinfo->tmpdir);
    433434                system(command);
     
    438439            log_msg(8,"scratchdir is %s", bkpinfo->scratchdir);
    439440            if (strstr(bkpinfo->scratchdir ,"mondo.scratch.") != NULL) {
    440                 log_msg(8,"erasing scratchdir");
     441                log_msg(8,"erasing scratchdir %s",bkpinfo->scratchdir);
    441442                mr_asprintf(&command, "rm -Rf %s", bkpinfo->scratchdir);
    442443                system(command);
Note: See TracChangeset for help on using the changeset viewer.