Ignore:
Timestamp:
Sep 27, 2007, 12:21:18 PM (12 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/mondoarchive/mondo-cli.c

    r1639 r1663  
    2525extern bool g_text_mode;
    2626extern char g_startdir[MAX_STR_LEN];    ///< ????? @bug ?????
    27 extern char g_erase_tmpdir_and_scratchdir[MAX_STR_LEN];
    2827extern char g_tmpfs_mountpt[MAX_STR_LEN];
    2928extern bool g_sigpipe;
     
    4443bool g_running_live = FALSE;    ///< ????? @bug ????? @ingroup globalGroup
    4544extern bool g_cd_recovery;
     45
     46extern void setup_tmpdir(char *path);
    4647
    4748/**
     
    6364char *g_getfacl = NULL;
    6465char *g_getfattr = NULL;
     66
     67/* Reference to global bkpinfo */
     68extern struct s_bkpinfo *bkpinfo;
    6569
    6670/**
     
    7680 */
    7781int
    78 handle_incoming_parameters(int argc, char *argv[],
    79                            struct s_bkpinfo *bkpinfo)
     82handle_incoming_parameters(int argc, char *argv[])
    8083{
    8184    /*@ int *** */
     
    8992    bool flag_set[128];
    9093
    91     sensibly_set_tmpdir_and_scratchdir(bkpinfo);
     94    sensibly_set_tmpdir_and_scratchdir();
    9295
    9396    for (i = 0; i < 128; i++) {
     
    99102    retval += res;
    100103    if (!retval) {
    101         res = process_switches(bkpinfo, flag_val, flag_set);
     104        res = process_switches(flag_val, flag_set);
    102105        retval += res;
    103106    }
     
    121124    mr_free(tmp);
    122125
    123     sprintf(bkpinfo->tmpdir + strlen(bkpinfo->tmpdir), "/tmp.mondo.%ld",
    124             random() % 32767);
    125126    sprintf(bkpinfo->scratchdir + strlen(bkpinfo->scratchdir),
    126127            "/mondo.scratch.%ld", random() % 32767);
     
    144145 * @bug Return code not needed.
    145146 */
    146 int process_the_s_switch(struct s_bkpinfo *bkpinfo, char *value)
     147int process_the_s_switch(char *value)
    147148{
    148149    char *tmp = NULL;
     
    180181 */
    181182int
    182 process_switches(struct s_bkpinfo *bkpinfo,
    183                  char flag_val[128][MAX_STR_LEN], bool flag_set[128])
     183process_switches(char flag_val[128][MAX_STR_LEN], bool flag_set[128])
    184184{
    185185
     
    425425                        ("For the moment, please don't specify a tape size. Mondo should handle end-of-tape gracefully anyway.");
    426426                }
    427                 if (process_the_s_switch(bkpinfo, flag_val['s'])) {
     427                if (process_the_s_switch(flag_val['s'])) {
    428428                    fatal_error("Bad -s switch");
    429429                }
     
    438438    } else {                    /* CD|USB size */
    439439        if (flag_set['s']) {
    440             if (process_the_s_switch(bkpinfo, flag_val['s'])) {
     440            if (process_the_s_switch(flag_val['s'])) {
    441441                fatal_error("Bad -s switch");
    442442            }
     
    672672    }
    673673    if (flag_set['T']) {
    674         sprintf(bkpinfo->tmpdir, "%s/tmp.mondo.%ld", flag_val['T'],
    675                 random() % 32768);
     674        setup_tmpdir(flag_val['T']);
    676675        mr_asprintf(&tmp2, "touch %s/.foo.dat", flag_val['T']);
    677676        if (run_program_and_log_output(tmp2, 1)) {
     
    683682        mr_free(tmp2);
    684683
    685         mr_asprintf(&tmp2, "ln -sf %s/.foo.dat %s/.bar.dat", flag_val['T'],
    686                 flag_val['T']);
     684        mr_asprintf(&tmp2, "ln -sf %s/.foo.dat %s/.bar.dat", bkpinfo->tmpdir, bkpinfo->tmpdir);
    687685        if (run_program_and_log_output(tmp2, 1)) {
    688686            retval++;
Note: See TracChangeset for help on using the changeset viewer.