Ignore:
Timestamp:
Sep 27, 2007, 12:21:18 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Fix bug #197 (based on an initial patch of Scott Cummings)
  • Fix a bug where df was using locale to print messages and wasn't filtered correctly
  • mkdtemp checked in configure
  • reset_bkpinfo called as early as possible by both main program.
  • It creates a tmpdir cleanly with mkdtemp in setup_tmpdir subfunction, which takes in account TMPIR and TMP env var. Remains to see what tmpfs does and tests
  • configure.in should also be filtered.
  • Remove g_bkpinfo_DONTUSETHIS
  • remove bkpinfo also from header files
  • Render bkpinfo global (potential issue on thread, but should not be a problem as that structure is indeed static during archive)
  • 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.
  • /tmp => /var/log for mondorestore.log in mindi
  • Update linux terminfo to fix a color issue (Andree Leidenfrost)
  • Removes useless log file (Andree Leidenfrost)
  • replace vi with find_my_editor during restore (Andree Leidenfrost)
  • sync in bg in mindi (VMWare issue to look at)
  • mindi/mindi-busybox have a different version than mondo for pb
  • PB-SUF also added to spec file
  • Fix a bug for pb build (omission of PB-SUF declaration)

(merge -r1631:1662 $SVN_M/branches/2.2.5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-fork.c

    r1626 r1663  
    2323extern bool g_text_mode;
    2424extern char *MONDO_LOGFILE;
     25
     26/* Reference to global bkpinfo */
     27extern struct s_bkpinfo *bkpinfo;
    2528pid_t g_buffer_pid = 0;
    2629extern struct mr_ar_conf *mr_conf;
     
    9194 */
    9295int
    93 eval_call_to_make_ISO(struct s_bkpinfo *bkpinfo,
    94                       char *basic_call, char *isofile,
     96eval_call_to_make_ISO(char *basic_call, char *isofile,
    9597                      int cd_no, char *logstub, char *what_i_am_doing)
    9698{
     
    211213    }
    212214    mr_asprintf(&callstr,
    213             "%s > /tmp/mondo-run-prog-thing.tmp 2> /tmp/mondo-run-prog-thing.err",
    214             program);
     215            "%s > %s/mondo-run-prog-thing.tmp 2> %s/mondo-run-prog-thing.err",
     216             program, bkpinfo->tmpdir, bkpinfo->tmpdir);
    215217    while ((p = strchr(callstr, '\r'))) {
    216218        *p = ' ';
     
    228230    mr_free(callstr);
    229231
    230     if (log_if_failure
    231         &&
    232         system
    233         ("cat /tmp/mondo-run-prog-thing.err >> /tmp/mondo-run-prog-thing.tmp 2> /dev/null"))
    234     {
     232    mr_asprintf(&callstr, "cat %s/mondo-run-prog-thing.err >> %s/mondo-run-prog-thing.tmp 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);
     233    if (log_if_failure && system(callstr)) {
    235234        log_OS_error("Command failed");
    236235    }
    237     unlink("/tmp/mondo-run-prog-thing.err");
    238     fin = fopen("/tmp/mondo-run-prog-thing.tmp", "r");
     236    mr_asprintf(&tmp, "%s/mondo-run-prog-thing.err", bkpinfo->tmpdir);
     237    unlink(tmp);
     238    mr_free(tmp);
     239
     240    mr_asprintf(&tmp, "%s/mondo-run-prog-thing.tmp", bkpinfo->tmpdir);
     241    fin = fopen(tmp, "r");
    239242    if (fin) {
    240243        for (mr_getline(&incoming, &n, fin); !feof(fin); mr_getline(&incoming, &n, fin)) {
     
    252255        paranoid_fclose(fin);
    253256    }
    254     unlink("/tmp/mondo-run-prog-thing.tmp");
     257    unlink(tmp);
     258    mr_free(tmp);
     259
    255260    if ((res == 0 && log_if_success) || (res != 0 && log_if_failure)) {
    256261        mr_msg(0,
     
    293298    assert_string_is_neither_NULL_nor_zerolength(basic_call);
    294299
    295     mr_asprintf(&lockfile, "/tmp/mojo-jojo.blah.XXXXXX");
    296     mkstemp(lockfile);
     300    sprintf(lockfile, "%s/mojo-jojo.bla.bla", bkpinfo->tmpdir);
     301
    297302    mr_asprintf(&command,
    298303            "echo hi > %s ; %s >> %s 2>> %s; res=$?; sleep 1; rm -f %s; exit $res",
     
    363368    char *tmp1 = NULL;
    364369    char *buf = NULL;
     370    char filestr[MAX_STR_LEN];
    365371    long int bytes_to_be_read, bytes_read_in, bytes_written_out =
    366372        0, bufcap, subsliceno = 0;
     
    469475            mr_msg(5, "tmpB is %s", tmp);
    470476            if (!strstr(tmp, PIMP_END_SZ)) {
    471                 ftmp = fopen("/tmp/out.leftover", "w");
     477                sprintf(filestr, "%s/out.leftover", bkpinfo->tmpdir);
     478                ftmp = fopen(filestr, "w");
    472479                bytes_read_in = fread(tmp, 1, 64L, fin);
    473480                mr_msg(1, "bytes_read_in = %ld", bytes_read_in);
     
    539546
    540547    strcpy(title, tt);
    541     strcpy(tempfile,
    542            call_program_and_get_last_line_of_output
    543            ("mktemp -q /tmp/mondo.XXXXXXXX"));
     548    sprintf(tempfile, "%s/mondo.binperc", bkpinfo->tmpdir);
    544549    mr_asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
    545550            tempfile);
Note: See TracChangeset for help on using the changeset viewer.