Ignore:
Timestamp:
Sep 23, 2007, 2:41:29 AM (17 years ago)
Author:
Bruno Cornec
Message:

Apply patch from Andree Leidenfrost, modified a bit to use bkpinfo->tmpdir instead of /tmp
or MINDI_CACHE when appropriate. Fix security issues in mondo
Thanks al ot Andree for catching all those issues.
Will not compile needs more work as bkpinfo->tmpdir isn't available everywhere
Should become a global in 3.x when only containing pointers.

File:
1 edited

Legend:

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

    r1437 r1644  
    999999    bkpinfo->scratchdir[0] = '\0';
    10001000    bkpinfo->make_filelist = TRUE;  // unless -J supplied to mondoarchive
    1001     sprintf(bkpinfo->tmpdir, "/tmp/tmpfs/mondo.tmp.%d", (int) (random() % 32768));  // for mondorestore
     1001    sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768));    // for mondorestore
    10021002    bkpinfo->optimal_set_size = 0;
    10031003    bkpinfo->backup_media_type = none;
     
    12271227        fatal_error("Please reinstall Mondo and Mindi.");
    12281228    }
    1229     if (run_program_and_log_output
    1230         ("mindi --makemountlist /tmp/mountlist.txt.test", 5)) {
    1231         log_to_screen
    1232             ("Mindi --makemountlist /tmp/mountlist.txt.test failed for some reason.");
     1229    sprintf(tmp, "mindi --makemountlist %s/mountlist.txt.test", bkpinfo->tmpdir);
     1230    if (run_program_and_log_output(tmp, 5)) {
     1231        sprintf(tmp, "mindi --makemountlist %s/mountlist.txt.test failed for some reason.", bkpinfo->tmpdir);
     1232        log_to_screen(tmp);
    12331233        log_to_screen
    12341234            ("Please run that command by hand and examine /var/log/mindi.log");
     
    14941494        return (1);
    14951495    }
    1496     strcpy(tempfile,
    1497            call_program_and_get_last_line_of_output
    1498            ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
     1496    sprintf(tempfile, "%s/mojo-jojo.blah", bkpinfo->tmpdir);
    14991497    if (does_file_exist(config_file)) {
    15001498        sprintf(command, "grep -vE '^%s .*$' %s > %s",
Note: See TracChangeset for help on using the changeset viewer.