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

    r1639 r1663  
    4949extern char *MONDO_LOGFILE;
    5050
     51/* Reference to global bkpinfo */
     52extern struct s_bkpinfo *bkpinfo;
     53
    5154/* Should we use or not extended attributes and acl when restoring */
    5255char *g_getfattr = NULL;
     
    141144 */
    142145int
    143 extract_config_file_from_ramdisk(struct s_bkpinfo *bkpinfo,
    144                                  char *ramdisk_fname,
    145                                  char *output_cfg_file,
    146                                  char *output_mountlist_file)
     146extract_config_file_from_ramdisk(char *ramdisk_fname,
     147                         char *output_cfg_file,
     148                         char *output_mountlist_file)
    147149{
    148150    char *mountpt = NULL;
     
    211213/**
    212214 * Keep trying to get mondo-restore.cfg from the archive, until the user gives up.
    213  * @param bkpinfo The backup information structure.
    214  */
    215 void get_cfg_file_from_archive_or_bust(struct s_bkpinfo *bkpinfo)
    216 {
    217     while (get_cfg_file_from_archive(bkpinfo)) {
     215 */
     216void get_cfg_file_from_archive_or_bust()
     217{
     218    while (get_cfg_file_from_archive()) {
    218219        if (!ask_me_yes_or_no
    219220            (_
     
    222223            fatal_error("Could not find config file/archives. Aborting.");
    223224        }
    224         interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
     225        interactively_obtain_media_parameters_from_user(FALSE);
    225226    }
    226227}
     
    285286 * @return 0 for success, nonzero for failure.
    286287 */
    287 int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please)
     288int iso_fiddly_bits(bool nuke_me_please)
    288289{
    289290    char *mount_isodir_command = NULL;
     
    341342    }
    342343    if (!IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    343         mount_cdrom(bkpinfo);
    344     }
    345     i = what_number_cd_is_this(bkpinfo);    /* has the side-effect of calling mount_cdrom() */
     344        mount_cdrom();
     345    }
     346    i = what_number_cd_is_this();   /* has the side-effect of calling mount_cdrom() */
    346347    mr_msg(1, "%s #%d has been mounted via loopback mount",
    347348            bkpinfo->backup_media_string, i);
     
    601602 * @return 0 for success, nonzero for failure.
    602603 */
    603 int mount_cdrom(struct s_bkpinfo *bkpinfo)
     604int mount_cdrom()
    604605{
    605606    char *mount_cmd = NULL;
     
    750751 * @return 0 for success, nonzero for failure.
    751752 */
    752 int read_cfg_file_into_bkpinfo(char *cfgf, struct s_bkpinfo *bkpinfo)
     753int read_cfg_file_into_bkpinfo(char *cfgf)
    753754{
    754755    char *value = NULL;
     
    10191020                    mr_asprintf(&iso_mnt, "");
    10201021                    mr_asprintf(&iso_path, "");
    1021                     if (mount_cdrom(bkpinfo)) {
     1022                    if (mount_cdrom()) {
    10221023                        fatal_error
    10231024                            ("Unable to mount isodir. Failed to mount CD-ROM as well.");
     
    10431044                mr_msg(2,
    10441045                        "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
    1045                 interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
     1046                interactively_obtain_media_parameters_from_user(FALSE);
    10461047                media_specified_by_user = bkpinfo->backup_media_type;
    1047                 get_cfg_file_from_archive(bkpinfo);
     1048                get_cfg_file_from_archive();
    10481049            }
    10491050        }
     
    10721073 */
    10731074struct
    1074 s_node *process_filelist_and_biggielist(struct s_bkpinfo *bkpinfo)
     1075s_node *process_filelist_and_biggielist()
    10751076{
    10761077    struct s_node *filelist = NULL;
     
    11151116                    "Calling insist_on_this_cd_number; bkpinfo->isodir=%s",
    11161117                    bkpinfo->isodir);
    1117             insist_on_this_cd_number(bkpinfo, 1);
     1118            insist_on_this_cd_number(1);
    11181119            mr_msg(2, "Back from iotcn");
    11191120            run_program_and_log_output("mount", 1);
     
    11251126                    FILELIST_FULL_STUB,
    11261127                    "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    1127 
    11281128            mr_msg(1, "tarcommand = %s", command);
    11291129            run_program_and_log_output(command, 1);
     
    17901790 * - @c bkpinfo->disaster_recovery
    17911791 */
    1792 void setup_MR_global_filenames(struct s_bkpinfo *bkpinfo)
     1792void setup_MR_global_filenames()
    17931793{
    17941794    char *temppath;
     
    20812081 * @return 0 for success, nonzero for failure.
    20822082 */
    2083 int get_cfg_file_from_archive(struct s_bkpinfo *bkpinfo)
     2083int get_cfg_file_from_archive()
    20842084{
    20852085    int retval = 0;
     
    21252125        } else {
    21262126            mr_msg(2, "gcffa --- calling mount_cdrom now :)");
    2127             if (!mount_cdrom(bkpinfo)) {
     2127            if (!mount_cdrom()) {
    21282128                mr_msg(2,
    21292129                        "gcffa --- managed to mount CD; so, no need for Plan B");
     
    21322132                try_plan_B = TRUE;
    21332133            }
    2134             if (what_number_cd_is_this(bkpinfo) > 1) {
    2135                 insist_on_this_cd_number(bkpinfo,
    2136                                          (g_current_media_number = 1));
     2134            if (what_number_cd_is_this() > 1) {
     2135                insist_on_this_cd_number((g_current_media_number = 1));
    21372136            }
    21382137        }
Note: See TracChangeset for help on using the changeset viewer.