Ignore:
Timestamp:
Jul 10, 2008, 6:37:04 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Protect recursive remove of tempdir with test on the look and feel of that dir to avoid removing blindly useful dir :-(
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.7/mondo/src/mondorestore/mondorestore.c

    r1987 r1999  
    31893189        }
    31903190        log_msg(2, "Still here. Yay.");
    3191         if (strlen(bkpinfo->tmpdir) > 0) {
     3191        if ((strlen(bkpinfo->tmpdir) > 0) && (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL)) {
    31923192            sprintf(tmp, "rm -Rf %s/*", bkpinfo->tmpdir);
    31933193            run_program_and_log_output(tmp, FALSE);
     
    33533353        run_program_and_log_output("mount / -o remount,rw", 2);
    33543354    }                           // for b0rken distros
    3355     sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir);
    3356     system(tmp);
     3355    if (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL) {
     3356        sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir);
     3357        system(tmp);
     3358    }
    33573359    paranoid_MR_finish(retval); // frees global stuff plus bkpinfo
    33583360    free_libmondo_global_strings(); // it's fine to have this here :) really :)
Note: See TracChangeset for help on using the changeset viewer.