Changeset 1663 for branches/stable


Ignore:
Timestamp:
Sep 27, 2007, 12:21:18 PM (12 years ago)
Author:
bruno
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)

Location:
branches/stable
Files:
1 deleted
57 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r1600 r1663  
    441441    fi
    442442
    443     sync
    444443    cd /
    445 
    446     # Unmount whtat could remain mounted
     444    sync&
     445
     446    # Unmount what could remain mounted
    447447    my_partitions=`mount | grep -F $$ | cut -f1 -d' '`
    448448    [ "$my_partitions" != "" ] && umount $my_partitions
  • branches/stable/mindi/rootfs/sbin/init

    r1621 r1663  
    435435MINDI_REV=RRR
    436436trap CaughtSoftReset SIGTERM
    437 LOGFILE=/tmp/mondorestore.log
     437LOGFILE=/var/log/mondorestore.log
    438438PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/mondo:/usr/games
    439439GROOVY=/tmp/groovy-stuff
  • branches/stable/mondo/configure.in

    r1638 r1663  
    117117AC_TYPE_SIGNAL
    118118AC_FUNC_VPRINTF
    119 AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr strspn getline asprintf trunc vasprintf])
     119AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr mkdtemp strspn getline asprintf trunc vasprintf])
    120120
    121121AC_OUTPUT([Makefile src/Makefile src/common/Makefile src/lib/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/restore-scripts/usr/Makefile src/restore-scripts/usr/bin/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile distributions/Makefile distributions/conf/Makefile])
  • branches/stable/mondo/src/common/libmondo-archive-EXT.h

    r1639 r1663  
    22
    33
    4 extern int archive_this_fileset(struct s_bkpinfo *bkpinfo, char *filelist,
     4extern int archive_this_fileset(char *filelist,
    55                                char *fname, int setno);
    6 extern int backup_data(struct s_bkpinfo *bkpinfo);
    7 extern int call_mindi_to_supply_boot_disks(struct s_bkpinfo *bkpinfo);
    8 extern bool can_we_fit_these_files_on_media(struct s_bkpinfo *bkpinfo,
     6extern int backup_data();
     7extern int call_mindi_to_supply_boot_disks();
     8extern bool can_we_fit_these_files_on_media(
    99                                            char *files_to_add, ...);
    10 extern int do_that_initial_phase(struct s_bkpinfo *bkpinfo);
    11 extern int do_that_final_phase(struct s_bkpinfo *bkpinfo);
     10extern int do_that_initial_phase();
     11extern int do_that_final_phase();
    1212extern int figure_out_kernel_path_interactively_if_necessary(char *kernel);
    13 extern int make_those_slices_phase(struct s_bkpinfo *bkpinfo);
    14 extern int make_those_afios_phase(struct s_bkpinfo *bkpinfo);
    15 extern int make_slices_and_images(struct s_bkpinfo *bkpinfo,
     13extern int make_those_slices_phase();
     14extern int make_those_afios_phase();
     15extern int make_slices_and_images(
    1616                                  char *biggielist_fname);
    17 extern int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile);
    18 extern int make_afioballs_and_images(struct s_bkpinfo *bkpinfo);
    19 extern int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...);
    20 extern int _move_files_to_cd(struct s_bkpinfo *bkpinfo, char *, ...);
    21 extern int (*move_files_to_stream) (struct s_bkpinfo *, char *, ...);
    22 extern int _move_files_to_stream(struct s_bkpinfo *bkpinfo,
     17extern int make_iso_fs(char *destfile);
     18extern int make_afioballs_and_images();
     19extern int (*move_files_to_cd) (char *, ...);
     20extern int _move_files_to_cd(char *, ...);
     21extern int (*move_files_to_stream) (char *, ...);
     22extern int _move_files_to_stream(
    2323                                 char *files_to_add, ...);
    2424extern void pause_and_ask_for_cdr(int);
    25 extern int slice_up_file_etc(struct s_bkpinfo *bkpinfo,
     25extern int slice_up_file_etc(
    2626                             char *biggie_filename,
    2727                             char *ntfsprog_fifo,
     
    2929                             long noof_biggie_files,
    3030                             bool use_ntfsprog);
    31 extern int verify_data(struct s_bkpinfo *bkpinfo);
     31extern int verify_data();
    3232extern void wipe_archives(char *d);
    33 extern int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, bool last_cd);
    34 extern int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo);
    35 extern int call_growisofs(struct s_bkpinfo *bkpinfo, char *destfile);
    36 extern int make_afioballs_and_images_SINGLETHREAD(struct s_bkpinfo
    37                                                   *bkpinfo);
    38 extern int archive_this_fileset_with_star(struct s_bkpinfo *bkpinfo,
     33extern int write_iso_and_go_on(bool last_cd);
     34extern int write_final_iso_if_necessary();
     35extern int call_growisofs(char *destfile);
     36extern int make_afioballs_and_images_SINGLETHREAD();
     37extern int archive_this_fileset_with_star(
    3938                                          char *filelist, char *fname,
    4039                                          int setno);
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1639 r1663  
    7979extern char *MONDO_LOGFILE;
    8080
     81/* Reference to global bkpinfo */
     82extern struct s_bkpinfo *bkpinfo;
     83
    8184
    8285
     
    198201
    199202int
    200 archive_this_fileset_with_star(struct s_bkpinfo *bkpinfo, char *filelist,
    201                                char *fname, int setno)
     203archive_this_fileset_with_star(char *filelist, char *fname, int setno)
    202204{
    203205    int retval = 0;
     
    297299 */
    298300int
    299 archive_this_fileset(struct s_bkpinfo *bkpinfo, char *filelist,
    300                      char *fname, int setno)
     301archive_this_fileset(char *filelist, char *fname, int setno)
    301302{
    302303
     
    319320
    320321    if (bkpinfo->compression_level > 0 && bkpinfo->use_star) {
    321         return (archive_this_fileset_with_star
    322                 (bkpinfo, filelist, fname, setno));
     322        return (archive_this_fileset_with_star(filelist, fname, setno));
    323323    }
    324324
     
    431431 * @ingroup archiveGroup
    432432 */
    433 int backup_data(struct s_bkpinfo *bkpinfo)
     433int backup_data()
    434434{
    435435    int retval = 0, res = 0;
     
    437437
    438438    assert(bkpinfo != NULL);
    439     set_g_cdrom_and_g_dvd_to_bkpinfo_value(bkpinfo);
     439    set_g_cdrom_and_g_dvd_to_bkpinfo_value();
    440440
    441441    if (bkpinfo->backup_media_type == dvd) {
     
    452452    }
    453453
    454     if ((res = prepare_filelist(bkpinfo))) {    /* generate scratchdir/filelist.full */
     454    if ((res = prepare_filelist())) {   /* generate scratchdir/filelist.full */
    455455        fatal_error("Failed to generate filelist catalog");
    456456    }
    457     if (call_filelist_chopper(bkpinfo)) {
     457    if (call_filelist_chopper()) {
    458458        fatal_error("Failed to run filelist chopper");
    459459    }
     
    472472    mr_free(tmp);
    473473
    474     copy_mondo_and_mindi_stuff_to_scratchdir(bkpinfo);  // payload, too, if it exists
     474    copy_mondo_and_mindi_stuff_to_scratchdir(); // payload, too, if it exists
    475475#if __FreeBSD__ == 5
    476476    strcpy(bkpinfo->kernel_path, "/boot/kernel/kernel");
     
    486486#error "I don't know about this system!"
    487487#endif
    488     if ((res = call_mindi_to_supply_boot_disks(bkpinfo))) {
     488    if ((res = call_mindi_to_supply_boot_disks())) {
    489489        fatal_error("Failed to generate boot+data disks");
    490490    }
    491     retval += do_that_initial_phase(bkpinfo);   // prepare
     491    retval += do_that_initial_phase();  // prepare
    492492    mr_asprintf(&tmp, "rm -f %s/images/*.iso", bkpinfo->scratchdir);
    493493    run_program_and_log_output(tmp, 1);
    494494    mr_free(tmp);
    495     retval += make_those_afios_phase(bkpinfo);  // backup regular files
    496     retval += make_those_slices_phase(bkpinfo); // backup BIG files
    497     retval += do_that_final_phase(bkpinfo); // clean up
     495    retval += make_those_afios_phase(); // backup regular files
     496    retval += make_those_slices_phase();    // backup BIG files
     497    retval += do_that_final_phase();    // clean up
    498498    mr_msg(1, "Creation of archives... complete.");
    499499    if (bkpinfo->verify_data) {
     
    529529 * @ingroup MLarchiveGroup
    530530 */
    531 int call_mindi_to_supply_boot_disks(struct s_bkpinfo *bkpinfo)
     531int call_mindi_to_supply_boot_disks()
    532532{
    533533    /*@ buffer ************************************************************ */
     
    10051005    char *curr_acl_list_fname;
    10061006
    1007     struct s_bkpinfo *bkpinfo;
     1007    struct s_bkpinfo *bkpinfo_bis;
    10081008    char *tmp = NULL;
    10091009    int res = 0, retval = 0;
     
    10201020    p_next_set_to_archive = (int *) (inbuf + 8);
    10211021    p_list_of_fileset_flags = (char *) (inbuf + 12);
    1022     bkpinfo = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);
     1022    bkpinfo_bis = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);
    10231023
    10241024    sprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ,
     
    10881088        mr_msg(4, "[%d:%d] - archiving %d...", getpid(),
    10891089                this_thread_no, archiving_set_no);
    1090         res = archive_this_fileset(bkpinfo, archiving_filelist_fname,
     1090        res =
     1091            archive_this_fileset(archiving_filelist_fname,
    10911092                                 archiving_afioball_fname,
    10921093                                 archiving_set_no);
     
    11411142 * @ingroup MLarchiveGroup
    11421143 */
    1143 int do_that_final_phase(struct s_bkpinfo *bkpinfo)
     1144int do_that_final_phase()
    11441145{
    11451146
     
    11571158    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    11581159        /* write tape/cdstream */
    1159         closeout_tape(bkpinfo);
     1160        closeout_tape();
    11601161    } else {
    11611162        /* write final ISO/USB */
    1162         res = write_final_iso_if_necessary(bkpinfo);
     1163        res = write_final_iso_if_necessary();
    11631164        retval += res;
    11641165        if (res) {
     
    12001201 * @ingroup MLarchiveGroup
    12011202 */
    1202 int do_that_initial_phase(struct s_bkpinfo *bkpinfo)
     1203int do_that_initial_phase()
    12031204{
    12041205    /*@ int *************************************** */
     
    13091310 * @return The number of errors encountered (0 for success)
    13101311 */
    1311 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo)
     1312int make_afioballs_and_images()
    13121313{
    13131314
     
    13671368                       _("Please wait. This may take a couple of hours."),
    13681369                       _("Working..."),
    1369                        get_last_filelist_number(bkpinfo) + 1);
     1370                       get_last_filelist_number() + 1);
    13701371
    13711372    srand((unsigned int) getpid());
     
    14331434                sleep(5);
    14341435            }
    1435             strcpy(media_usage_comment,
    1436                    percent_media_full_comment(bkpinfo));
     1436            strcpy(media_usage_comment, percent_media_full_comment());
    14371437            /* copy to CD (scratchdir) ... and an actual CD-R if necessary */
    14381438            if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
     
    14421442                                                       storing_afioball_fname);
    14431443                iamhere("Writing EXAT files");
    1444                 res += write_EXAT_files_to_tape(bkpinfo,
    1445                                                 curr_xattr_list_fname,
     1444                res += write_EXAT_files_to_tape(curr_xattr_list_fname,
    14461445                                                curr_acl_list_fname);
    14471446                // archives themselves
    14481447                res +=
    1449                     move_files_to_stream(bkpinfo, storing_afioball_fname,
     1448                    move_files_to_stream(storing_afioball_fname,
    14501449                                         NULL);
    14511450            } else {
    14521451                if (g_getfacl) {
    14531452                    if (g_getfattr) {
    1454                         res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1453                        res = move_files_to_cd(storing_filelist_fname,
    14551454                                     curr_xattr_list_fname,
    14561455                                     curr_acl_list_fname,
    14571456                                     storing_afioball_fname, NULL);
    14581457                    } else {
    1459                         res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1458                        res = move_files_to_cd(storing_filelist_fname,
    14601459                                    curr_acl_list_fname,
    14611460                                    storing_afioball_fname, NULL);
     
    14631462                } else {
    14641463                    if (g_getfattr) {
    1465                             res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1464                            res = move_files_to_cd(storing_filelist_fname,
    14661465                                    curr_xattr_list_fname,
    14671466                                    storing_afioball_fname, NULL);
    14681467                    } else {
    1469                             res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1468                            res = move_files_to_cd(storing_filelist_fname,
    14701469                                    storing_afioball_fname, NULL);
    14711470                    }
     
    15451544 * @return The number of errors encountered (0 for success)
    15461545 */
    1547 int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile)
     1546int make_iso_fs(char *destfile)
    15481547{
    15491548    /*@ int ********************************************** */
     
    15921591        mr_asprintf(&message_to_screen, "Running pre-ISO call for CD#%d",
    15931592                g_current_media_number);
    1594         res = eval_call_to_make_ISO(bkpinfo, bkpinfo->call_before_iso,
     1593        res = eval_call_to_make_ISO(bkpinfo->call_before_iso,
    15951594                                destfile, g_current_media_number,
    15961595                                MONDO_LOGFILE, message_to_screen);
     
    16181617                ("Serious error(s) occurred already. I shan't try to write to media.");
    16191618        } else {
    1620             res = eval_call_to_make_ISO(bkpinfo, bkpinfo->call_make_iso,
     1619            res = eval_call_to_make_ISO(bkpinfo->call_make_iso,
    16211620                                        destfile, g_current_media_number,
    16221621                                        MONDO_LOGFILE, message_to_screen);
     
    16801679                pause_for_N_seconds(5, "Letting DVD drive settle");
    16811680                res =
    1682                     eval_call_to_make_ISO(bkpinfo, bkpinfo->call_make_iso,
     1681                    eval_call_to_make_ISO(bkpinfo->call_make_iso,
    16831682                                          destfile,
    16841683                                          g_current_media_number,
     
    17241723                 bkpinfo->backup_media_string,
    17251724                 g_current_media_number);
    1726         res = eval_call_to_make_ISO(bkpinfo, bkpinfo->call_after_iso,
     1725        res = eval_call_to_make_ISO(bkpinfo->call_after_iso,
    17271726                                    destfile, g_current_media_number,
    17281727                                    MONDO_LOGFILE, message_to_screen);
     
    17831782 */
    17841783int
    1785 make_slices_and_images(struct s_bkpinfo *bkpinfo, char *biggielist_fname)
     1784make_slices_and_images(char *biggielist_fname)
    17861785{
    17871786
     
    18141813
    18151814    estimated_total_noof_slices =
    1816         size_of_all_biggiefiles_K(bkpinfo) / bkpinfo->optimal_set_size + 1;
     1815        size_of_all_biggiefiles_K() / bkpinfo->optimal_set_size + 1;
    18171816
    18181817    mr_msg(1, "size of all biggiefiles = %ld",
    1819             size_of_all_biggiefiles_K(bkpinfo));
     1818            size_of_all_biggiefiles_K());
    18201819    mr_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld",
    1821             size_of_all_biggiefiles_K(bkpinfo), bkpinfo->optimal_set_size,
     1820            size_of_all_biggiefiles_K(), bkpinfo->optimal_set_size,
    18221821            estimated_total_noof_slices);
    18231822
     
    19091908            }
    19101909            res =
    1911                 slice_up_file_etc(bkpinfo, bigfile_fname,
     1910                slice_up_file_etc(bigfile_fname,
    19121911                                  ntfsprog_fifo, biggie_file_number,
    19131912                                  noof_biggie_files, use_ntfsprog);
     
    19571956 * @see make_afioballs_and_images
    19581957 */
    1959 int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo)
     1958int make_afioballs_and_images_OLD()
    19601959{
    19611960
     
    19831982                       _("Please wait. This may take a couple of hours."),
    19841983                       _("Working..."),
    1985                        get_last_filelist_number(bkpinfo) + 1);
     1984                       get_last_filelist_number() + 1);
    19861985
    19871986    mr_asprintf(&curr_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir,
     
    20072006
    20082007        mr_msg(1, "Archiving set %ld", curr_set_no);
    2009         res = archive_this_fileset(bkpinfo, curr_filelist_fname,
     2008        res = archive_this_fileset(curr_filelist_fname,
    20102009                                 curr_afioball_fname, curr_set_no);
    20112010        retval += res;
     
    20182017        }
    20192018
    2020         strcpy(media_usage_comment, percent_media_full_comment(bkpinfo));
     2019        strcpy(media_usage_comment, percent_media_full_comment());
    20212020
    20222021        /* copy to CD (scratchdir) ... and an actual CD-R if necessary */
     
    20272026                                                   curr_afioball_fname);
    20282027            iamhere("Writing EXAT files");
    2029             res += write_EXAT_files_to_tape(bkpinfo, curr_xattr_list_fname,
     2028            res += write_EXAT_files_to_tape(curr_xattr_list_fname,
    20302029                                            curr_acl_list_fname);
    20312030            // archives themselves
    2032             res = move_files_to_stream(bkpinfo, curr_afioball_fname, NULL);
     2031            res = move_files_to_stream(curr_afioball_fname, NULL);
    20332032        } else {
    20342033                if (g_getfacl) {
    20352034                    if (g_getfattr) {
    2036                         res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2035                        res = move_files_to_cd(curr_filelist_fname,
    20372036                                     curr_xattr_list_fname,
    20382037                                     curr_acl_list_fname,
    20392038                                     curr_afioball_fname, NULL);
    20402039                    } else {
    2041                         res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2040                        res = move_files_to_cd(curr_filelist_fname,
    20422041                                    curr_acl_list_fname,
    20432042                                    curr_afioball_fname, NULL);
     
    20452044                } else {
    20462045                    if (g_getfattr) {
    2047                             res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2046                            res = move_files_to_cd(curr_filelist_fname,
    20482047                                    curr_xattr_list_fname,
    20492048                                    curr_afioball_fname, NULL);
    20502049                    } else {
    2051                             res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2050                            res = move_files_to_cd(curr_filelist_fname,
    20522051                                    curr_afioball_fname, NULL);
    20532052                    }
     
    20972096 * @ingroup MLarchiveGroup
    20982097 */
    2099 int make_those_afios_phase(struct s_bkpinfo *bkpinfo)
     2098int make_those_afios_phase()
    21002099{
    21012100    /*@ int ******************************************* */
     
    21142113        mr_msg(1,
    21152114                "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0");
    2116         res = make_afioballs_and_images_OLD(bkpinfo);
     2115        res = make_afioballs_and_images_OLD();
    21172116#else
    2118         res = make_afioballs_and_images_OLD(bkpinfo);
     2117        res = make_afioballs_and_images_OLD();
    21192118#endif
    21202119        write_header_block_to_stream((off_t)0, "stop-afioballs",
    21212120                                     BLK_STOP_AFIOBALLS);
    21222121    } else {
    2123         res = make_afioballs_and_images(bkpinfo);
     2122        res = make_afioballs_and_images();
    21242123    }
    21252124
     
    21432142 * @ingroup MLarchiveGroup
    21442143 */
    2145 int make_those_slices_phase(struct s_bkpinfo *bkpinfo)
     2144int make_those_slices_phase()
    21462145{
    21472146
     
    21952194
    21962195    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2197         res += write_EXAT_files_to_tape(bkpinfo, xattr_fname, acl_fname);
     2196        res += write_EXAT_files_to_tape(xattr_fname, acl_fname);
    21982197        mr_asprintf(&blah, "%ld", count_lines_in_file(biggielist));
    21992198        write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES);
     
    22072206    }
    22082207
    2209     res = make_slices_and_images(bkpinfo, biggielist);
     2208    res = make_slices_and_images(biggielist);
    22102209    mr_free(biggielist);
    22112210
     
    22342233 * transfer files over the network) or leave it as is.
    22352234 */
    2236 int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...) =
     2235int (*move_files_to_cd) (char *, ...) =
    22372236    _move_files_to_cd;
    22382237
     
    22552254 * @return The number of errors encountered (0 for success)
    22562255 */
    2257 int _move_files_to_cd(struct s_bkpinfo *bkpinfo, char *files_to_add, ...)
     2256int _move_files_to_cd(char *files_to_add, ...)
    22582257{
    22592258
     
    22962295    if (would_occupy / 1024 > bkpinfo->media_size) {
    22972296        /* FALSE because this is not the last CD we'll write */
    2298         res = write_iso_and_go_on(bkpinfo, FALSE);
     2297        res = write_iso_and_go_on(FALSE);
    22992298        retval += res;
    23002299        if (res) {
     
    23442343 * transfer files over the network) or leave it as is.
    23452344 */
    2346 int (*move_files_to_stream) (struct s_bkpinfo *, char *, ...) =
     2345int (*move_files_to_stream) (char *, ...) =
    23472346    _move_files_to_stream;
    23482347
     
    23612360 */
    23622361int
    2363 _move_files_to_stream(struct s_bkpinfo *bkpinfo, char *files_to_add, ...)
     2362_move_files_to_stream(char *files_to_add, ...)
    23642363{
    23652364
     
    24052404            type = other;
    24062405        }
    2407         res = write_file_to_stream_from_file(bkpinfo, curr_file);
     2406        res = write_file_to_stream_from_file(curr_file);
    24082407        retval += res;
    24092408        unlink(curr_file);
     
    25172516    }
    25182517    log_to_screen("Scanning CD-ROM drive...");
    2519     sprintf(mtpt, "/tmp/cd.mtpt.%ld.%ld", (long int) random(),
    2520             (long int) random());
     2518    sprintf(mtpt, "%s/cd.mtpt", bkpinfo->tmpdir);
    25212519    make_hole_for_dir(mtpt);
    25222520
     
    26702668 */
    26712669int
    2672 slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename,
     2670slice_up_file_etc(char *biggie_filename,
    26732671                  char *ntfsprog_fifo, long biggie_file_number,
    26742672                  long noof_biggie_files, bool use_ntfsprog)
     
    27972795    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    27982796        res =
    2799             move_files_to_stream(bkpinfo,
    2800                                  slice_fname(biggie_file_number, 0,
     2797            move_files_to_stream(slice_fname(biggie_file_number, 0,
    28012798                                             bkpinfo->tmpdir, ""), NULL);
    28022799    } else {
    28032800        res =
    2804             move_files_to_cd(bkpinfo,
    2805                              slice_fname(biggie_file_number, 0,
     2801            move_files_to_cd(slice_fname(biggie_file_number, 0,
    28062802                                         bkpinfo->tmpdir, ""), NULL);
    28072803    }
     
    28232819                           suffix));
    28242820
    2825         mr_asprintf(&tmp, percent_media_full_comment(bkpinfo));
     2821        mr_asprintf(&tmp, percent_media_full_comment());
    28262822        update_progress_form(tmp);
    28272823        mr_free(tmp);
     
    29172913            maintain_collection_of_recent_archives(bkpinfo->tmpdir,
    29182914                                                   file_to_archive);
    2919             res = move_files_to_stream(bkpinfo, file_to_archive, NULL);
     2915            res = move_files_to_stream(file_to_archive, NULL);
    29202916        } else {
    2921             res = move_files_to_cd(bkpinfo, file_to_archive, NULL);
     2917            res = move_files_to_cd(file_to_archive, NULL);
    29222918        }
    29232919        mr_free(file_to_archive);
     
    30143010 * however, this occurs rarely.
    30153011 */
    3016 int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo)
     3012int write_final_iso_if_necessary()
    30173013{
    30183014    /*@ int ***************************************************** */
     
    30373033#endif
    30383034    mr_free(tmp);
    3039     res = write_iso_and_go_on(bkpinfo, TRUE);
     3035    res = write_iso_and_go_on(TRUE);
    30403036#ifndef _XWIN
    30413037    if (!g_text_mode) {
     
    30653061 * @see make_iso_fs
    30663062 */
    3067 int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, bool last_cd)
     3063int write_iso_and_go_on(bool last_cd)
    30683064{
    30693065    /*@ pointers **************************************************** */
     
    31473143    for (that_one_was_ok = FALSE; !that_one_was_ok;) {
    31483144        if (bkpinfo->backup_media_type != usb) {
    3149             res = make_iso_fs(bkpinfo, isofile);
     3145            res = make_iso_fs(isofile);
    31503146        } else {
    31513147        }
     
    31683164            chdir("/");
    31693165            iamhere("Before calling verify_cd_image()");
    3170             res += verify_cd_image(bkpinfo);
     3166            res += verify_cd_image();
    31713167            iamhere("After calling verify_cd_image()");
    31723168        }
     
    32273223 * @ingroup verifyGroup
    32283224 */
    3229 int verify_data(struct s_bkpinfo *bkpinfo)
     3225int verify_data()
    32303226{
    32313227    int res = 0, retval = 0, cdno = 0;
     
    32383234        mvaddstr_and_log_it(g_currentY, 0,
    32393235                            "Verifying archives against live filesystem");
    3240         verify_tape_backups(bkpinfo);
     3236        verify_tape_backups();
    32413237        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    32423238    } else if (bkpinfo->backup_data)
     
    32453241        mr_msg(2,
    32463242                "Not verifying again. Per-CD/ISO verification already carried out.");
    3247         paranoid_system
    3248             ("cat /tmp/changed.files.* > /tmp/changed.files 2> /dev/null");
     3243        sprintf(tmp, "cat %s/changed.files > %s/changed.files 2> /dev/null",bkpinfo->tmpdir, MINDI_CACHE);
     3244        paranoid_system(tmp);
    32493245    } else {
    32503246        g_current_media_number = cdno;
     
    32583254            }
    32593255            if (bkpinfo->backup_media_type != iso) {
    3260                 insist_on_this_cd_number(bkpinfo, cdno);
    3261             }
    3262             res = verify_cd_image(bkpinfo); // sets verify_data to FALSE if it's time to stop verifying
     3256                insist_on_this_cd_number(cdno);
     3257            }
     3258            res = verify_cd_image();    // sets verify_data to FALSE if it's time to stop verifying
    32633259            retval += res;
    32643260            if (res) {
    32653261                mr_asprintf(&tmp,
    3266                          "Warnings/errors were reported while checking %s #%d",
    3267                          bkpinfo->backup_media_string,
    3268                          g_current_media_number);
     3262                        "Warnings/errors were reported while checking %s #%d",
     3263                        media_descriptor_string(bkpinfo->backup_media_type),
     3264                        g_current_media_number);
    32693265                log_to_screen(tmp);
    32703266                mr_free(tmp);
     
    32733269        }
    32743270        mr_asprintf(&tmp,
    3275                  "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",
    3276                  MONDO_LOGFILE);
     3271                "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files",
     3272                MONDO_LOGFILE, MINDI_CACHE);
    32773273        system(tmp);
    32783274        mr_free(tmp);
    32793275
    32803276        mr_asprintf(&tmp,
    3281                  "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",
    3282                  MONDO_LOGFILE);
     3277                "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files",
     3278                MONDO_LOGFILE, MINDI_CACHE);
    32833279        system(tmp);
    32843280        mr_free(tmp);
     
    32873283        eject_device(bkpinfo->media_device);
    32883284    }
    3289     diffs = count_lines_in_file("/tmp/changed.files");
     3285    sprintf(tmp, "%s/changed.files", MINDI_CACHE);
     3286    diffs = count_lines_in_file(tmp);
    32903287
    32913288    if (diffs > 0) {
  • branches/stable/mondo/src/common/libmondo-archive.h

    r1639 r1663  
    33 */
    44
    5 int archive_this_fileset(struct s_bkpinfo *bkpinfo, char *filelist,
     5int archive_this_fileset(char *filelist,
    66                         char *fname, int setno);
    7 int backup_data(struct s_bkpinfo *bkpinfo);
    8 int call_mindi_to_supply_boot_disks(struct s_bkpinfo *bkpinfo);
    9 bool can_we_fit_these_files_on_media(struct s_bkpinfo *bkpinfo,
     7int backup_data();
     8int call_mindi_to_supply_boot_disks();
     9bool can_we_fit_these_files_on_media(
    1010                                     char *files_to_add, ...);
    11 int do_that_initial_phase(struct s_bkpinfo *bkpinfo);
    12 int do_that_final_phase(struct s_bkpinfo *bkpinfo);
     11int do_that_initial_phase();
     12int do_that_final_phase();
    1313int figure_out_kernel_path_interactively_if_necessary(char *kernel);
    1414bool get_bit_N_of_array(char *array, int N);
    15 int make_those_slices_phase(struct s_bkpinfo *bkpinfo);
    16 int make_those_afios_phase(struct s_bkpinfo *bkpinfo);
    17 int make_slices_and_images(struct s_bkpinfo *bkpinfo,
     15int make_those_slices_phase();
     16int make_those_afios_phase();
     17int make_slices_and_images(
    1818                           char *biggielist_fname);
    19 int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile);
    20 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo);
    21 extern int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...);
    22 int _move_files_to_cd(struct s_bkpinfo *bkpinfo, char *files_to_add, ...);
    23 extern int (*move_files_to_stream) (struct s_bkpinfo *, char *, ...);
    24 int _move_files_to_stream(struct s_bkpinfo *bkpinfo, char *files_to_add,
     19int make_iso_fs(char *destfile);
     20int make_afioballs_and_images();
     21extern int (*move_files_to_cd) (char *, ...);
     22int _move_files_to_cd(char *files_to_add, ...);
     23extern int (*move_files_to_stream) (char *, ...);
     24int _move_files_to_stream(char *files_to_add,
    2525                          ...);
    2626void pause_and_ask_for_cdr(int);
    2727void set_bit_N_of_array(char *array, int N, bool true_or_false);
    28 int slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename,
     28int slice_up_file_etc(char *biggie_filename,
    2929                      char *ntfsprog_fifo,
    3030                      long biggie_file_number, long noof_biggie_files,
    3131                      bool use_ntfsprog);
    32 int verify_data(struct s_bkpinfo *bkpinfo);
     32int verify_data();
    3333void wipe_archives(char *d);
    34 int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, bool last_cd);
    35 int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo);
    36 int call_growisofs(struct s_bkpinfo *bkpinfo, char *destfile);
    37 int make_afioballs_and_images_SINGLETHREAD(struct s_bkpinfo *bkpinfo);
    38 int archive_this_fileset_with_star(struct s_bkpinfo *bkpinfo,
     34int write_iso_and_go_on(bool last_cd);
     35int write_final_iso_if_necessary();
     36int call_growisofs(char *destfile);
     37int make_afioballs_and_images_SINGLETHREAD();
     38int archive_this_fileset_with_star(
    3939                                   char *filelist, char *fname, int setno);
    4040void setenv_mondo_share(void);
  • branches/stable/mondo/src/common/libmondo-devices-EXT.h

    r1156 r1663  
    77extern int does_partition_exist(const char *drive, int partno);
    88extern bool does_string_exist_in_boot_block(char *dev, char *str);
    9 extern int find_and_mount_actual_cd(struct s_bkpinfo *bkpinfo,
     9extern int find_and_mount_actual_cd(
    1010                                    char *mountpoint);
    1111extern int find_cdrom_device(char *output, bool try_to_mount);
     
    3131
    3232
    33 extern int interactively_obtain_media_parameters_from_user(struct s_bkpinfo
    34                                                            *, bool);
    35 extern void insist_on_this_cd_number(struct s_bkpinfo *bkpinfo,
     33extern int interactively_obtain_media_parameters_from_user(bool);
     34extern void insist_on_this_cd_number(
    3635                                     int cd_number_i_want);
    3736
    3837
    39 extern int what_number_cd_is_this(struct s_bkpinfo *bkpinfo);
     38extern int what_number_cd_is_this();
    4039
    4140
     
    4443extern char *list_of_NFS_mounts_only(void);
    4544
    46 extern void sensibly_set_tmpdir_and_scratchdir(struct s_bkpinfo *bkpinfo);
     45extern void sensibly_set_tmpdir_and_scratchdir();
    4746
    4847
     
    5958                                                            *incoming);
    6059
    61 extern void set_g_cdrom_and_g_dvd_to_bkpinfo_value(struct s_bkpinfo
    62                                                    *bkpinfo);
     60extern void set_g_cdrom_and_g_dvd_to_bkpinfo_value();
    6361
    6462extern bool is_dev_an_NTFS_dev(char *bigfile_fname);
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1638 r1663  
    5050extern struct mr_ar_conf *mr_conf;
    5151
     52extern void setup_tmpdir(char *path);
     53
    5254static char g_cdrw_drive_is_here[MAX_STR_LEN / 4] = "";
    5355static char g_cdrom_drive_is_here[MAX_STR_LEN / 4] = "";
     
    6365extern t_bkptype g_backup_media_type;   // set by main()
    6466
    65 
    66 
    67 
    68 void set_g_cdrom_and_g_dvd_to_bkpinfo_value(struct s_bkpinfo *bkpinfo)
     67/* Reference to global bkpinfo */
     68extern struct s_bkpinfo *bkpinfo;
     69
     70
     71
     72
     73void set_g_cdrom_and_g_dvd_to_bkpinfo_value()
    6974{
    7075    strcpy(g_cdrom_drive_is_here, bkpinfo->media_device);   // just in case
     
    502507 * @see mount_CDROM_here
    503508 */
    504 int find_and_mount_actual_cd(struct s_bkpinfo *bkpinfo, char *mountpoint)
     509int find_and_mount_actual_cd(char *mountpoint)
    505510{
    506511    /*@ buffers ***************************************************** */
     
    690695    }
    691696
    692     sprintf(mountpoint, "/tmp/cd.%d", (int) (random() % 32767));
     697    sprintf(mountpoint, "%s/cd.mnt", bkpinfo->tmpdir);
    693698    make_hole_for_dir(mountpoint);
    694699
     
    13211326 */
    13221327void
    1323 insist_on_this_cd_number(struct s_bkpinfo *bkpinfo, int cd_number_i_want)
     1328insist_on_this_cd_number(int cd_number_i_want)
    13241329{
    13251330
     
    13551360            run_program_and_log_output("umount " MNT_CDROM, 5);
    13561361        }
    1357         system("mkdir -p /tmp/isodir &> /dev/null");
     1362        sprintf(tmp, "mkdir -p %s/isodir &> /dev/null", bkpinfo->tmpdir);
     1363        system(tmp);
    13581364        mr_asprintf(&tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir,
    13591365                bkpinfo->nfs_remote_dir, bkpinfo->prefix,
     
    13611367        if (!does_file_exist(tmp)) {
    13621368            mr_free(tmp);
    1363             mr_asprintf(&tmp, "/tmp/isodir/%s/%s-%d.iso",
     1369            mr_asprintf(&tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir,
    13641370                    bkpinfo->nfs_remote_dir, bkpinfo->prefix,
    13651371                    cd_number_i_want);
    13661372            if (does_file_exist(tmp)) {
    13671373                mr_msg(1,
    1368                         "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir",
    1369                         bkpinfo->isodir);
    1370                 strcpy(bkpinfo->isodir, "/tmp/isodir");
     1374                        "FIXME - hacking bkpinfo->isodir from '%s' to %s/isodir",
     1375                        bkpinfo->isodir, bkpinfo->tmpdir);
     1376                sprintf(bkpinfo->isodir, "%s/isodir", bkpinfo->tmpdir);
    13711377            }
    13721378        }
     
    13771383        mr_free(tmp);
    13781384    }
    1379     if ((res = what_number_cd_is_this(bkpinfo)) != cd_number_i_want) {
     1385    if ((res = what_number_cd_is_this()) != cd_number_i_want) {
    13801386        mr_msg(3, "Currently, we hold %d but we want %d", res,
    13811387                cd_number_i_want);
     
    13891395        mr_free(tmp);
    13901396
    1391         while (what_number_cd_is_this(bkpinfo) != cd_number_i_want) {
     1397        while (what_number_cd_is_this() != cd_number_i_want) {
    13921398            sync();
    13931399            if (is_this_device_mounted(MNT_CDROM)) {
     
    14321438 * @ingroup archiveGroup
    14331439 */
    1434 int interactively_obtain_media_parameters_from_user(struct s_bkpinfo
    1435                                                     *bkpinfo,
    1436                                                     bool
    1437                                                     archiving_to_media)
     1440int interactively_obtain_media_parameters_from_user(bool archiving_to_media)
    14381441// archiving_to_media is TRUE if I'm being called by mondoarchive
    14391442// archiving_to_media is FALSE if I'm being called by mondorestore
     
    14651468            bkptype_to_string(bkpinfo->backup_media_type));
    14661469    if (archiving_to_media) {
    1467         sensibly_set_tmpdir_and_scratchdir(bkpinfo);
     1470        sensibly_set_tmpdir_and_scratchdir();
    14681471    }
    14691472    bkpinfo->compression_level =
     
    15661569            mr_msg(1, "bkpinfo->media_device = %s", bkpinfo->media_device);
    15671570            mr_asprintf(&comment,
    1568                 _("Please specify your %s drive's /dev entry"), bkpinfo->backup_media_string);
     1571                _("Please specify your %s drive's /dev entry"), media_descriptor_string(bkpinfo->backup_media));
    15691572            mr_asprintf(&tmp,"/dev/cdrom");
    15701573            if (!popup_and_get_string
     
    17311734        }
    17321735        if (bkpinfo->disaster_recovery) {
    1733             system("umount /tmp/isodir 2> /dev/null");
     1736            sprintf(command ,"umount %s/isodir 2> /dev/null", bkpinfo->tmpdir);
     1737            system(command);
    17341738            if (!popup_and_get_string
    17351739                ("NFS share", "Which remote NFS share should I mount?",
     
    17401744        }
    17411745        if (!is_this_device_mounted(bkpinfo->nfs_mount)) {
    1742             sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d",
    1743                     (int) (random() % 32768));
     1746            sprintf(bkpinfo->isodir, "%s/nfsdir", bkpinfo->tmpdir);
    17441747            mr_asprintf(&command, "mkdir -p %s", bkpinfo->isodir);
    17451748            run_program_and_log_output(command, 5);
     
    20702073 * @ingroup utilityGroup
    20712074 */
    2072 void sensibly_set_tmpdir_and_scratchdir(struct s_bkpinfo *bkpinfo)
     2075void sensibly_set_tmpdir_and_scratchdir()
    20732076{
    20742077    char *tmp = NULL;
     
    20832086    mr_asprintf(&tmp,
    20842087           call_program_and_get_last_line_of_output
    2085            ("df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs,afs,ocfs,ocfs2,mvfs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2088           ("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs,afs,ocfs,ocfs2,mvfs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    20862089#else
    20872090    mr_asprintf(&tmp,
    20882091           call_program_and_get_last_line_of_output
    2089            ("df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs -x afs -x ocfs -x ocfs2 -x mvfs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2092           ("LANGUAGE=C df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs -x afs -x ocfs -x ocfs2 -x mvfs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    20902093#endif
    20912094
     
    20982101        fatal_error("I couldn't figure out the tempdir!");
    20992102    }
    2100     i = (int) (random() % 32768);
    2101     sprintf(bkpinfo->tmpdir, "%s/tmp.mondo.%d", tmp, i);
     2103    setup_tmpdir(tmp);
    21022104    log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir);
    21032105
    21042106    sprintf(bkpinfo->scratchdir, "%s/mondo.scratch.%d", tmp, i);
    21052107    log_it("bkpinfo->scratchdir is being set to %s", bkpinfo->scratchdir);
    2106 
    2107     sprintf(g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir,
    2108             bkpinfo->scratchdir);
    21092108
    21102109    mr_asprintf(&command, "rm -Rf %s/tmp.mondo.* %s/mondo.scratch.*", tmp, tmp);
     
    21652164 * (and remain mounted after this function returns).
    21662165 */
    2167 int what_number_cd_is_this(struct s_bkpinfo *bkpinfo)
     2166int what_number_cd_is_this()
    21682167{
    21692168    int cd_number = -1;
  • branches/stable/mondo/src/common/libmondo-devices.h

    r1156 r1663  
    1010int does_partition_exist(const char *drive, int partno);
    1111bool does_string_exist_in_boot_block(char *dev, char *str);
    12 int find_and_mount_actual_cd(struct s_bkpinfo *bkpinfo, char *mountpoint);
     12int find_and_mount_actual_cd(char *mountpoint);
    1313int find_cdrom_device(char *output, bool try_to_mount);
    1414int find_dvd_device(char *output, bool try_to_mount);
     
    2828int find_cdrw_device(char *cdrw_device);
    2929
    30 int interactively_obtain_media_parameters_from_user(struct s_bkpinfo *,
    31                                                     bool);
     30int interactively_obtain_media_parameters_from_user(bool);
    3231
    33 void insist_on_this_cd_number(struct s_bkpinfo *bkpinfo,
     32void insist_on_this_cd_number(
    3433                              int cd_number_i_want);
    3534
    36 int what_number_cd_is_this(struct s_bkpinfo *bkpinfo);
     35int what_number_cd_is_this();
    3736
    3837int eject_device(char *);
     
    4039char *list_of_NFS_mounts_only(void);
    4140
    42 void sensibly_set_tmpdir_and_scratchdir(struct s_bkpinfo *bkpinfo);
     41void sensibly_set_tmpdir_and_scratchdir();
    4342
    4443
     
    5352bool does_nonMS_partition_exist(void);
    5453char *resolve_softlinks_to_get_to_actual_device_file(char *incoming);
    55 void set_g_cdrom_and_g_dvd_to_bkpinfo_value(struct s_bkpinfo *bkpinfo);
     54void set_g_cdrom_and_g_dvd_to_bkpinfo_value();
    5655
    5756bool is_dev_an_NTFS_dev(char *bigfile_fname);
  • branches/stable/mondo/src/common/libmondo-fifo.c

    r1543 r1663  
    200200/* BERLIOS: useless ?
    201201int
    202 extract_config_file_from_ramdisk( struct s_bkpinfo *bkpinfo,
     202extract_config_file_from_ramdisk(
    203203                  char *ramdisk_fname,
    204204                  char *output_cfg_file,
  • branches/stable/mondo/src/common/libmondo-filelist-EXT.h

    r128 r1663  
    22
    33extern int chop_filelist(char *filelist, char *outdir, long maxsetsizeK);
    4 extern int call_filelist_chopper(struct s_bkpinfo *bkpinfo);
     4extern int call_filelist_chopper();
    55extern void free_filelist(struct s_node *filelist);
    6 extern int get_last_filelist_number(struct s_bkpinfo *bkpinfo);
     6extern int get_last_filelist_number();
    77extern int add_string_at_node(struct s_node *startnode,
    88                              char *string_to_add);
     
    1616                                  bool on_or_off);
    1717extern void toggle_node_selection(struct s_node *filelist, bool on_or_off);
    18 extern int prepare_filelist(struct s_bkpinfo *bkpinfo);
     18extern int prepare_filelist();
    1919
    2020extern long save_filelist_entries_in_common(char *needles_list_fname,
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1639 r1663  
    4040extern char *MONDO_LOGFILE;
    4141
     42/* Reference to global bkpinfo */
     43extern struct s_bkpinfo *bkpinfo;
     44
    4245int mondo_makefilelist(char *logfile, char *tmpdir, char *scratchdir,
    4346                       char *include_paths, char *excp, bool differential,
     
    8285 * @see chop_filelist
    8386 */
    84 int call_filelist_chopper(struct s_bkpinfo *bkpinfo)
     87int call_filelist_chopper()
    8588{
    8689    /*@ buffers *********************** */
     
    112115    mr_free(filelist);
    113116
    114     estimate_noof_media_required(bkpinfo, noof_sets);   // for cosmetic purposes
     117    estimate_noof_media_required(noof_sets);    // for cosmetic purposes
    115118
    116119    mr_asprintf(&tempfile, "%s/biggielist.txt", bkpinfo->tmpdir);
     
    155158
    156159    mr_msg(5, "Sorting file %s", orig_fname);
    157     mr_asprintf(&tmp_fname, "/tmp/sort.%d.%d.%d", (int) (random() % 32768),
    158              (int) (random() % 32768), (int) (random() % 32768));
     160    mr_asprintf(&tmp_fname, "%s/sortfile", bkpinfo->tmpdir);
    159161
    160162    if (!does_file_exist(orig_fname)) {
     
    547549        return (0);
    548550    }
    549     mr_asprintf(&masklist, "/tmp/%d.%d.mask", (int) (random() % 32768),
    550              (int) (random() % 32768));
    551 
     551    mr_asprintf(&masklist, "%s/masklist", bkpinfo->tmpdir);
    552552    mr_asprintf(&command, "cp -f %s %s", orig_msklist, masklist);
    553553    run_program_and_log_output(command, 1);
     
    693693 * @note This function should only be called at restore-time.
    694694 */
    695 int get_last_filelist_number(struct s_bkpinfo *bkpinfo)
     695int get_last_filelist_number()
    696696{
    697697    /*@ buffers ***************************************************** */
     
    12391239 * @see mondo_makefilelist
    12401240 */
    1241 int prepare_filelist(struct s_bkpinfo *bkpinfo)
     1241int prepare_filelist()
    12421242{
    12431243
  • branches/stable/mondo/src/common/libmondo-filelist.h

    r128 r1663  
    44
    55int chop_filelist(char *filelist, char *outdir, long maxsetsizeK);
    6 int call_filelist_chopper(struct s_bkpinfo *bkpinfo);
     6int call_filelist_chopper();
    77void free_filelist(struct s_node *filelist);
    8 int get_last_filelist_number(struct s_bkpinfo *bkpinfo);
     8int get_last_filelist_number();
    99int add_string_at_node(struct s_node *startnode, char *string_to_add);
    1010struct s_node *load_filelist(char *filelist_fname);
     
    1717                           bool on_or_off);
    1818void toggle_node_selection(struct s_node *filelist, bool on_or_off);
    19 int prepare_filelist(struct s_bkpinfo *bkpinfo);
     19int prepare_filelist();
    2020
    2121long save_filelist_entries_in_common(char *needles_list_fname,
  • branches/stable/mondo/src/common/libmondo-files-EXT.h

    r1113 r1663  
    2929
    3030
    31 extern long size_of_all_biggiefiles_K(struct s_bkpinfo *bkpinfo);
    32 extern void copy_mondo_and_mindi_stuff_to_scratchdir(struct s_bkpinfo
    33                                                      *bkpinfo);
    34 extern void store_nfs_config(struct s_bkpinfo *bkpinfo);
     31extern long size_of_all_biggiefiles_K();
     32extern void copy_mondo_and_mindi_stuff_to_scratchdir();
     33extern void store_nfs_config();
    3534
    3635
    37 extern void estimate_noof_media_required(struct s_bkpinfo *bkpinfo, long);
     36extern void estimate_noof_media_required(long);
    3837
    3938extern bool is_this_file_compressed(char *);
  • branches/stable/mondo/src/common/libmondo-files.c

    r1594 r1663  
    3030
    3131extern int g_currentY;
     32
     33/* Reference to global bkpinfo */
     34extern struct s_bkpinfo *bkpinfo;
    3235
    3336/**
     
    680683 * @return The total size of all biggiefiles in KB.
    681684 */
    682 long size_of_all_biggiefiles_K(struct s_bkpinfo *bkpinfo)
     685long size_of_all_biggiefiles_K()
    683686{
    684687    char *fname = NULL;
     
    940943 * - @c bkpinfo->tmpdir
    941944 */
    942 void copy_mondo_and_mindi_stuff_to_scratchdir(struct s_bkpinfo *bkpinfo)
     945void copy_mondo_and_mindi_stuff_to_scratchdir()
    943946{
    944947    /*@ Char buffers ** */
     
    10261029 * - @c tmpdir
    10271030 */
    1028 void store_nfs_config(struct s_bkpinfo *bkpinfo)
     1031void store_nfs_config()
    10291032{
    10301033
     
    11561159 */
    11571160void
    1158 estimate_noof_media_required(struct s_bkpinfo *bkpinfo, long noof_sets)
     1161estimate_noof_media_required(long noof_sets)
    11591162{
    11601163    /*@ buffers *************** */
     
    11721175    scratchLL =
    11731176        (long long) (noof_sets) * (long long) (bkpinfo->optimal_set_size)
    1174         + (long long) (size_of_all_biggiefiles_K(bkpinfo));
     1177        + (long long) (size_of_all_biggiefiles_K());
    11751178    scratchLL = (scratchLL / 1024) / bkpinfo->media_size;
    11761179    scratchLL++;
  • branches/stable/mondo/src/common/libmondo-files.h

    r1113 r1663  
    2424long noof_lines_that_match_wildcard(char *filelist_fname, char *wildcard);
    2525void register_pid(pid_t pid, char *name_str);
    26 long size_of_all_biggiefiles_K(struct s_bkpinfo *bkpinfo);
     26long size_of_all_biggiefiles_K();
    2727long long space_occupied_by_cd(char *mountpt);
    2828int whine_if_not_found(char *fname);
    2929int write_one_liner_data_file(char *fname, char *contents);
    3030
    31 void copy_mondo_and_mindi_stuff_to_scratchdir(struct s_bkpinfo *bkpinfo);
    32 void store_nfs_config(struct s_bkpinfo *bkpinfo);
    33 void estimate_noof_media_required(struct s_bkpinfo *bkpinfo, long);
     31void copy_mondo_and_mindi_stuff_to_scratchdir();
     32void store_nfs_config();
     33void estimate_noof_media_required(long);
    3434bool is_this_file_compressed(char *);
    3535
  • branches/stable/mondo/src/common/libmondo-fork-EXT.h

    r296 r1663  
    55                                         char *what_i_am_doing);
    66extern int run_program_and_log_output(char *program, int);
    7 extern int eval_call_to_make_ISO(struct s_bkpinfo *bkpinfo,
    8                                  char *basic_call, char *isofile,
     7extern int eval_call_to_make_ISO(char *basic_call, char *isofile,
    98                                 int cd_no, char *logstub,
    109                                 char *what_i_am_doing);
  • 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);
  • branches/stable/mondo/src/common/libmondo-fork.h

    r296 r1663  
    88int run_program_and_log_to_screen(char *basic_call, char *what_i_am_doing);
    99int run_program_and_log_output(char *program, int);
    10 int eval_call_to_make_ISO(struct s_bkpinfo *bkpinfo,
    11                           char *basic_call, char *isofile,
     10int eval_call_to_make_ISO(char *basic_call, char *isofile,
    1211                          int cd_no, char *logstub, char *what_i_am_doing);
    1312
  • branches/stable/mondo/src/common/libmondo-mountlist.c

    r1548 r1663  
    2424/*@unused@*/
    2525//static char cvsid[] = "$Id$";
     26
     27/* Reference to global bkpinfo */
     28extern struct s_bkpinfo *bkpinfo;
    2629
    2730/**
  • branches/stable/mondo/src/common/libmondo-stream-EXT.h

    r684 r1663  
    33
    44
    5 extern int closein_tape(struct s_bkpinfo *bkpinfo);
    6 extern int closeout_tape(struct s_bkpinfo *bkpinfo);
     5extern int closein_tape();
     6extern int closeout_tape();
    77extern int find_tape_device_and_size(char *dev, char *siz);
    88extern void insist_on_this_tape_number(int tapeno);
     
    1010extern int maintain_collection_of_recent_archives(char *td,
    1111                                                  char *latest_fname);
    12 extern int openin_cdstream(struct s_bkpinfo *bkpinfo);
    13 extern int openin_tape(struct s_bkpinfo *bkpinfo);
     12extern int openin_cdstream();
     13extern int openin_tape();
    1414extern int openout_cdstream(char *cddev, int speed);
    1515extern int openout_tape(char *tapedev, long internal_tape_block_size);
    16 extern int read_file_from_stream_to_file(struct s_bkpinfo *bkpinfo,
     16extern int read_file_from_stream_to_file(
    1717                                         char *outfile, long long size);
    18 extern int read_file_from_stream_to_stream(struct s_bkpinfo *bkpinfo,
     18extern int read_file_from_stream_to_stream(
    1919                                           FILE * fout, long long size);
    20 extern int read_file_from_stream_FULL(struct s_bkpinfo *bkpinfo,
     20extern int read_file_from_stream_FULL(
    2121                                      char *outfname, FILE * foutstream,
    2222                                      long long orig_size);
     
    3030extern int skip_incoming_files_until_we_find_this_one(char
    3131                                                      *the_file_I_was_reading);
    32 extern int start_to_read_from_next_tape(struct s_bkpinfo *bkpinfo);
    33 extern int start_to_write_to_next_tape(struct s_bkpinfo *bkpinfo);
    34 extern int write_backcatalog_to_tape(struct s_bkpinfo *bkpinfo);
     32extern int start_to_read_from_next_tape();
     33extern int start_to_write_to_next_tape();
     34extern int write_backcatalog_to_tape();
    3535extern int write_data_disks_to_stream(char *fname);
    36 extern int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo,
     36extern int write_file_to_stream_from_file(
    3737                                          char *infile);
    3838extern int write_header_block_to_stream(off_t length_of_incoming_file,
    3939                                        char *filename, int control_char);
    4040extern void wrong_marker(int should_be, int it_is);
    41 extern int closein_cdstream(struct s_bkpinfo *bkpinfo);
    42 extern int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo,
     41extern int closein_cdstream();
     42extern int read_EXAT_files_from_tape(
    4343                                     long long *ptmp_size, char *tmp_fname,
    4444                                     int *pctrl_chr, char *xattr_fname,
    4545                                     char *acl_fname);
    46 extern int write_EXAT_files_to_tape(struct s_bkpinfo *bkpinfo,
     46extern int write_EXAT_files_to_tape(
    4747                                    char *xattr_fname, char *acl_fname);
  • branches/stable/mondo/src/common/libmondo-stream.c

    r1639 r1663  
    4242extern struct mr_ar_conf *mr_conf;
    4343
     44/* Reference to global bkpinfo */
     45extern struct s_bkpinfo *bkpinfo;
     46
    4447/**
    4548 * @addtogroup globalGroup
     
    127130 * @note This should be called by restore processes only.
    128131 */
    129 int closein_cdstream(struct s_bkpinfo *bkpinfo)
    130 {
    131     return (closein_tape(bkpinfo));
     132int closein_cdstream()
     133{
     134    return (closein_tape());
    132135}
    133136
     
    142145 * @bug @p bkpinfo parameter is unused.
    143146 */
    144 int closein_tape(struct s_bkpinfo *bkpinfo)
     147int closein_tape()
    145148{
    146149    /*@ int's ******************************************************* */
     
    195198 * @note This should be called by backup processes only.
    196199 */
    197 int closeout_tape(struct s_bkpinfo *bkpinfo)
     200int closeout_tape()
    198201{
    199202    /*@ int's ******************************************************* */
     
    224227        if (should_we_write_to_next_tape
    225228            (bkpinfo->media_size, (off_t)256 * 1024)) {
    226             start_to_write_to_next_tape(bkpinfo);
     229            start_to_write_to_next_tape();
    227230        }
    228231    }
     
    354357
    355358
    356 int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo,
    357                               long long *ptmp_size, char *tmp_fname,
     359int read_EXAT_files_from_tape(long long *ptmp_size, char *tmp_fname,
    358360                              int *pctrl_chr, char *xattr_fname,
    359361                              char *acl_fname)
     
    372374            fatal_error("Wrong order, sunshine.");
    373375        }
    374         read_file_from_stream_to_file(bkpinfo, xattr_fname, *ptmp_size);
     376        read_file_from_stream_to_file(xattr_fname, *ptmp_size);
    375377        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    376378        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     
    388390            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    389391        }
    390         read_file_from_stream_to_file(bkpinfo, acl_fname, *ptmp_size);
     392        read_file_from_stream_to_file(acl_fname, *ptmp_size);
    391393        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    392394        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     
    406408
    407409
    408 int write_EXAT_files_to_tape(struct s_bkpinfo *bkpinfo, char *xattr_fname,
     410int write_EXAT_files_to_tape(char *xattr_fname,
    409411                             char *acl_fname)
    410412{
     
    416418        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    417419                             BLK_START_EXAT_FILE);
    418         write_file_to_stream_from_file(bkpinfo, xattr_fname);
     420        write_file_to_stream_from_file(xattr_fname);
    419421        write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
    420422    }
     
    423425        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    424426                             BLK_START_EXAT_FILE);
    425         write_file_to_stream_from_file(bkpinfo, acl_fname);
     427        write_file_to_stream_from_file(acl_fname);
    426428        write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    427429        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     
    570572 * @note Equivalent to openin_tape() for now, but don't count on this behavior.
    571573 */
    572 int openin_cdstream(struct s_bkpinfo *bkpinfo)
    573 {
    574     return (openin_tape(bkpinfo));
     574int openin_cdstream()
     575{
     576    return (openin_tape());
    575577}
    576578
     
    603605 * @note This will also work with a cdstream for now, but don't count on this behavior.
    604606 */
    605 int openin_tape(struct s_bkpinfo *bkpinfo)
     607int openin_tape()
    606608{
    607609    /*@ buffer ***************************************************** */
     
    778780 */
    779781int
    780 read_file_from_stream_to_file(struct s_bkpinfo *bkpinfo, char *outfile,
    781                               long long size)
     782read_file_from_stream_to_file(char *outfile, long long size)
    782783{
    783784
     
    787788    /*@ end vars *************************************************** */
    788789
    789     res = read_file_from_stream_FULL(bkpinfo, outfile, NULL, size);
     790    res = read_file_from_stream_FULL(outfile, NULL, size);
    790791
    791792    return (res);
     
    802803 */
    803804int
    804 read_file_from_stream_to_stream(struct s_bkpinfo *bkpinfo, FILE * fout,
    805                                 long long size)
     805read_file_from_stream_to_stream(FILE * fout, long long size)
    806806{
    807807
     
    811811    /*@ end vars *************************************************** */
    812812
    813     res = read_file_from_stream_FULL(bkpinfo, NULL, fout, size);
     813    res = read_file_from_stream_FULL(NULL, fout, size);
    814814    return (res);
    815815}
     
    829829 */
    830830int
    831 read_file_from_stream_FULL(struct s_bkpinfo *bkpinfo, char *outfname,
    832                            FILE * foutstream, long long orig_size)
     831read_file_from_stream_FULL(char *outfname, FILE * foutstream, long long orig_size)
    833832{
    834833    /*@ buffers ***************************************************** */
     
    915914            mr_msg(4, "where_I_was_... = %lld",
    916915                    where_I_was_before_tape_change);
    917             start_to_read_from_next_tape(bkpinfo);
     916            start_to_read_from_next_tape();
    918917            mr_msg(4, "Started reading from next tape.");
    919918            skip_incoming_files_until_we_find_this_one(temp_fname);
     
    12381237 * @return 0 for success, nonzero for failure.
    12391238 */
    1240 int start_to_read_from_next_tape(struct s_bkpinfo *bkpinfo)
     1239int start_to_read_from_next_tape()
    12411240{
    12421241    /*@ int ********************************************************* */
     
    12841283 * @return 0 for success, nonzero for failure.
    12851284 */
    1286 int start_to_write_to_next_tape(struct s_bkpinfo *bkpinfo)
     1285int start_to_write_to_next_tape()
    12871286{
    12881287    int res = 0;
     
    13391338 * @return 0 for success, nonzero for failure.
    13401339 */
    1341 int write_backcatalog_to_tape(struct s_bkpinfo *bkpinfo)
     1340int write_backcatalog_to_tape()
    13421341{
    13431342    int res = 0;
     
    13581357                                         BLK_START_AN_AFIO_OR_SLICE);
    13591358            mr_msg(2, "Writing %s", fname);
    1360             if (write_file_to_stream_from_file(bkpinfo, fname)) {
     1359            if (write_file_to_stream_from_file(fname)) {
    13611360                res++;
    13621361                mr_msg(2, "%s failed", fname);
     
    14431442 * @return 0 for success, nonzero for failure.
    14441443 */
    1445 int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo, char *infile)
     1444int write_file_to_stream_from_file(char *infile)
    14461445{
    14471446    /*@ buffers **************************************************** */
     
    14891488    if (should_we_write_to_next_tape
    14901489        (bkpinfo->media_size, filesize)) {
    1491         start_to_write_to_next_tape(bkpinfo);
    1492         write_backcatalog_to_tape(bkpinfo);
     1490        start_to_write_to_next_tape();
     1491        write_backcatalog_to_tape();
    14931492    }
    14941493    p = strrchr(infile, '/');
     
    15281527            fclose(fin);
    15291528            g_sigpipe = FALSE;
    1530             start_to_write_to_next_tape(bkpinfo);
    1531             write_backcatalog_to_tape(bkpinfo); // kinda-sorta recursive :)
     1529            start_to_write_to_next_tape();
     1530            write_backcatalog_to_tape();    // kinda-sorta recursive :)
    15321531            return (0);
    15331532        }
  • branches/stable/mondo/src/common/libmondo-stream.h

    r684 r1663  
    55
    66
    7 int closein_tape(struct s_bkpinfo *bkpinfo);
    8 int closeout_tape(struct s_bkpinfo *bkpinfo);
     7int closein_tape();
     8int closeout_tape();
    99int find_tape_device_and_size(char *dev, char *siz);
    1010void insist_on_this_tape_number(int tapeno);
    1111void log_tape_pos(void);
    1212int maintain_collection_of_recent_archives(char *td, char *latest_fname);
    13 int openin_cdstream(struct s_bkpinfo *bkpinfo);
    14 int openin_tape(struct s_bkpinfo *bkpinfo);
     13int openin_cdstream();
     14int openin_tape();
    1515int openout_cdstream(char *cddev, int speed);
    1616int openout_tape(char *tapedev, long internal_tape_block_size);
    17 int read_file_from_stream_to_file(struct s_bkpinfo *bkpinfo, char *outfile,
     17int read_file_from_stream_to_file(char *outfile,
    1818                                  long long size);
    19 int read_file_from_stream_to_stream(struct s_bkpinfo *bkpinfo, FILE * fout,
     19int read_file_from_stream_to_stream(FILE * fout,
    2020                                    long long size);
    21 int read_file_from_stream_FULL(struct s_bkpinfo *bkpinfo, char *outfname,
     21int read_file_from_stream_FULL(char *outfname,
    2222                               FILE * foutstream, long long orig_size);
    2323int read_header_block_from_stream(long long *plen, char *filename,
     
    2929int skip_incoming_files_until_we_find_this_one(char
    3030                                               *the_file_I_was_reading);
    31 int start_to_read_from_next_tape(struct s_bkpinfo *bkpinfo);
    32 int start_to_write_to_next_tape(struct s_bkpinfo *bkpinfo);
    33 int write_backcatalog_to_tape(struct s_bkpinfo *bkpinfo);
     31int start_to_read_from_next_tape();
     32int start_to_write_to_next_tape();
     33int write_backcatalog_to_tape();
    3434int write_data_disks_to_stream(char *fname);
    35 int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo,
     35int write_file_to_stream_from_file(
    3636                                   char *infile);
    3737int write_header_block_to_stream(off_t length_of_incoming_file,
    3838                                 char *filename, int control_char);
    3939void wrong_marker(int should_be, int it_is);
    40 int closein_cdstream(struct s_bkpinfo *bkpinfo);
    41 int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo,
     40int closein_cdstream();
     41int read_EXAT_files_from_tape(
    4242                              long long *ptmp_size, char *tmp_fname,
    4343                              int *pctrl_chr, char *xattr_fname,
    4444                              char *acl_fname);
    45 int write_EXAT_files_to_tape(struct s_bkpinfo *bkpinfo, char *xattr_fname,
     45int write_EXAT_files_to_tape(char *xattr_fname,
    4646                             char *acl_fname);
  • branches/stable/mondo/src/common/libmondo-string-EXT.h

    r1241 r1663  
    3535extern int severity_of_difference(char *filename, char *out_reason);
    3636
    37 extern char *percent_media_full_comment(struct s_bkpinfo *bkpinfo);
     37extern char *percent_media_full_comment();
    3838
    3939
  • branches/stable/mondo/src/common/libmondo-string.c

    r1591 r1663  
    2525extern int g_current_media_number;
    2626extern long long g_tape_posK;
     27
     28/* Reference to global bkpinfo */
     29extern struct s_bkpinfo *bkpinfo;
    2730
    2831/**
     
    865868 * @note The returned string points to static storage that will be overwritten with each call.
    866869 */
    867 char *percent_media_full_comment(struct s_bkpinfo *bkpinfo)
     870char *percent_media_full_comment()
    868871{
    869872    /*@ int *********************************************** */
  • branches/stable/mondo/src/common/libmondo-string.h

    r1241 r1663  
    3030int severity_of_difference(char *filename, char *out_reason);
    3131
    32 char *percent_media_full_comment(struct s_bkpinfo *bkpinfo);
     32char *percent_media_full_comment();
    3333char *media_descriptor_string(t_bkptype);
  • branches/stable/mondo/src/common/libmondo-tools-EXT.h

    r1625 r1663  
    88extern int read_cfg_var(char *config_file, char *label, char *value);
    99extern int write_cfg_var(char *config_file, char *label, char *value);
    10 extern void reset_bkpinfo(struct s_bkpinfo *bkpinfo);
     10extern void reset_bkpinfo();
    1111#ifdef __FreeBSD__
    1212extern void initialize_raidrec(struct vinum_volume *vv);
     
    2323extern void remount_supermounts_if_necessary(void);
    2424
    25 extern int post_param_configuration(struct s_bkpinfo *bkpinfo);
     25extern int post_param_configuration();
    2626
    2727
    28 extern int pre_param_configuration(struct s_bkpinfo *bkpinfo);
     28extern int pre_param_configuration();
    2929
    3030
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1639 r1663  
    2323#include <sys/socket.h>
    2424#include <netdb.h>
     25#include <stdlib.h>
    2526#include <netinet/in.h>
    2627#include <arpa/inet.h>
     
    3940
    4041extern struct mr_ar_conf *mr_conf;
     42
     43/* Reference to global bkpinfo */
     44extern struct s_bkpinfo *bkpinfo;
    4145
    4246/**
     
    347351 * do not exist.
    348352 */
    349 int post_param_configuration(struct s_bkpinfo *bkpinfo)
     353int post_param_configuration()
    350354{
    351355    char *extra_cdrom_params = NULL;
     
    383387    }
    384388    make_hole_for_dir(bkpinfo->scratchdir);
    385     make_hole_for_dir(bkpinfo->tmpdir);
    386389    if (bkpinfo->backup_media_type == iso)
    387390        make_hole_for_dir(bkpinfo->isodir);
     
    620623            }
    621624        }
    622         store_nfs_config(bkpinfo);
     625        store_nfs_config();
    623626        mr_free(hostname);
    624627    }
     
    638641    }
    639642    chmod(bkpinfo->scratchdir, 0700);
    640     chmod(bkpinfo->tmpdir, 0700);
    641643    g_backup_media_type = bkpinfo->backup_media_type;
    642644    g_backup_media_string = bkpinfo->backup_media_string;
     
    652654 * @return number of errors (0 for success)
    653655 */
    654 int pre_param_configuration(struct s_bkpinfo *bkpinfo)
     656int pre_param_configuration()
    655657{
    656658    int res = 0;
     659    char *tmp = NULL;
    657660
    658661    make_hole_for_dir(MNT_CDROM);
     
    660663    srandom((unsigned long) (time(NULL)));
    661664    insmod_crucial_modules();
    662     reset_bkpinfo(bkpinfo);     // also sets defaults ('/'=backup path, 3=compression level)
    663665    if (bkpinfo->disaster_recovery) {
    664666        if (!does_nonMS_partition_exist()) {
     
    668670    }
    669671
    670     run_program_and_log_output("rm -Rf /tmp/changed.files*", FALSE);
     672    asprintf(&tmp,"rm -Rf %s/changed.files*",MINDI_CACHE);
     673    run_program_and_log_output(tmp, FALSE);
     674    paranoid_free(tmp);
    671675    res += some_basic_system_sanity_checks();
    672676    if (res) {
     
    678682}
    679683
    680 
     684void setup_tmpdir(char *path) {
     685   
     686    char *tmp = NULL;
     687    char *p = NULL;
     688
     689    if (bkpinfo->tmpdir != NULL) {
     690        /* purging a potential old tmpdir */
     691        asprintf(&tmp,"rm -Rf %s",bkpinfo->tmpdir);
     692        system(tmp);
     693        paranoid_free(tmp);
     694    }
     695       
     696    if (path != NULL) {
     697        asprintf(&tmp, "%s/mondo.tmp.XXXXXX", path);
     698    } else if (getenv("TMPDIR")) {
     699        asprintf(&tmp, "%s/mondo.tmp.XXXXXX", getenv("TMPDIR"));
     700    } else if (getenv("TMP")) {
     701        asprintf(&tmp, "%s/mondo.tmp.XXXXXX", getenv("TMP"));
     702    } else {
     703        asprintf(&tmp, "/tmp/mondo.tmp.XXXXXX");
     704    }
     705    p = mkdtemp(tmp);
     706    if (p == NULL) {
     707        log_it("Failed to create global tmp directory %s for Mondo.",tmp);
     708        finish(-1);
     709    }
     710    strcpy(bkpinfo->tmpdir,p);
     711    paranoid_free(tmp);
     712
     713    //sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768));  // for mondorestore
     714}
    681715
    682716
     
    685719 * @param bkpinfo The @c bkpinfo to reset.
    686720 */
    687 void reset_bkpinfo(struct s_bkpinfo *bkpinfo)
     721void reset_bkpinfo()
    688722{
    689723    char *tmp = NULL;
     
    694728    /* BERLIOS : Useless ?? */
    695729    memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
     730
     731    /* special case for tmpdir as used eveywhere after */
     732    setup_tmpdir(NULL);
    696733
    697734    bkpinfo->manual_tray = mr_conf->manual_tray;
     
    726763    bkpinfo->scratchdir[0] = '\0';
    727764    bkpinfo->make_filelist = TRUE;  // unless -J supplied to mondoarchive
    728     sprintf(bkpinfo->tmpdir, "/tmp/tmpfs/mondo.tmp.%d", (int) (random() % 32768));  // for mondorestore
    729765    bkpinfo->optimal_set_size = 0;
    730766    bkpinfo->backup_media_type = none;
     
    952988        fatal_error("Please reinstall Mondo and Mindi.");
    953989    }
    954     if (run_program_and_log_output
    955         ("mindi --makemountlist /tmp/mountlist.txt.test", 5)) {
     990    mr_asprintf(&tmp, "mindi --makemountlist %s/mountlist.txt.test", bkpinfo->tmpdir);
     991    if (run_program_and_log_output(tmp, 5)) {
     992        log_to_screen(tmp);
    956993        log_to_screen
    957             (_("Mindi --makemountlist /tmp/mountlist.txt.test failed for some reason."));
     994            (_("failed for some reason."));
    958995        log_to_screen
    959996            (_("Please run that command by hand and examine /var/log/mindi.log"));
     
    9641001        retval++;
    9651002    }
     1003    mr_free(tmp);
    9661004
    9671005    if (!run_program_and_log_output("parted2fdisk -l | grep -i raid", 1)
     
    11561194        return (1);
    11571195    }
    1158     mr_asprintf(&tempfile,
    1159            call_program_and_get_last_line_of_output
    1160            ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
     1196    mr_asprintf(&tempfile, "%s/mojo-jojo.blah", bkpinfo->tmpdir);
    11611197    if (does_file_exist(config_file)) {
    11621198        mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s",
     
    11851221{
    11861222    if (mal) {
    1187         iamhere("Malloc'ing globals");
    11881223        malloc_string(g_boot_mountpt);
    11891224        malloc_string(g_tmpfs_mountpt);
     
    11921227        malloc_string(g_magicdev_command);
    11931228    } else {
    1194         iamhere("Freeing globals");
    11951229        mr_free(g_boot_mountpt);
    11961230        mr_free(g_tmpfs_mountpt);
  • branches/stable/mondo/src/common/libmondo-tools.h

    r1384 r1663  
    1111int read_cfg_var(char *config_file, char *label, char *value);
    1212int write_cfg_var(char *config_file, char *label, char *value);
    13 void reset_bkpinfo(struct s_bkpinfo *bkpinfo);
     13void reset_bkpinfo();
    1414#ifdef __FreeBSD__
    1515void initialize_raidrec(struct vinum_volume *vv);
     
    2727void remount_supermounts_if_necessary(void);
    2828
    29 int post_param_configuration(struct s_bkpinfo *bkpinfo);
     29int post_param_configuration();
    3030
    3131
    32 int pre_param_configuration(struct s_bkpinfo *bkpinfo);
     32int pre_param_configuration();
    3333
    3434long free_space_on_given_partition(char *partition);
  • branches/stable/mondo/src/common/libmondo-verify-EXT.h

    r128 r1663  
    22
    33
    4 extern int verify_cd_image(struct s_bkpinfo *);
    5 extern int verify_a_tarball(struct s_bkpinfo *, char *);
    6 extern int verify_an_afioball_from_CD(struct s_bkpinfo *, char *);
    7 extern int verify_an_afioball_from_tape(struct s_bkpinfo *, char *,
     4extern int verify_cd_image();
     5extern int verify_a_tarball(char *);
     6extern int verify_an_afioball_from_CD(char *);
     7extern int verify_an_afioball_from_tape(char *,
    88                                        long long);
    9 extern int verify_a_biggiefile_from_tape(struct s_bkpinfo *, char *,
     9extern int verify_a_biggiefile_from_tape(char *,
    1010                                         long long);
    11 int verify_afioballs_from_CD(struct s_bkpinfo *);
    12 extern int verify_afioballs_from_tape(struct s_bkpinfo *);
    13 extern int verify_biggiefiles_from_tape(struct s_bkpinfo *);
    14 extern int verify_tape_backups(struct s_bkpinfo *);
    15 extern char *vfy_tball_fname(struct s_bkpinfo *, char *, int);
     11int verify_afioballs_from_CD();
     12extern int verify_afioballs_from_tape();
     13extern int verify_biggiefiles_from_tape();
     14extern int verify_tape_backups();
     15extern char *vfy_tball_fname(char *, int);
  • branches/stable/mondo/src/common/libmondo-verify.c

    r1609 r1663  
    2525//static char cvsid[] = "$Id$";
    2626
    27 char *vfy_tball_fname(struct s_bkpinfo *, char *, int);
    28 
    29 
    3027/**
    3128 * The number of the most recently verified afioball.
     
    3734extern char *g_getfattr;
    3835extern char *MONDO_LOGFILE;
     36
     37/* Reference to global bkpinfo */
     38extern struct s_bkpinfo *bkpinfo;
     39
     40
     41/**
     42 * Generate the filename of a tarball to verify.
     43 * @param bkpinfo The backup information structure. @c bkpinfo->zip_suffix is the only field used.
     44 * @param mountpoint The directory where the CD/DVD/ISO is mounted.
     45 * @param setno The afioball number to get the location of.
     46 * @return The absolute path to the afioball.
     47 * @note The returned string points to static data that will be overwritten with each call.
     48 * @ingroup stringGroup
     49 */
     50char *vfy_tball_fname(char *mountpoint, int setno)
     51{
     52    /*@ buffers ******************************************************* */
     53    static char output[MAX_STR_LEN];
     54
     55    assert(bkpinfo != NULL);
     56    assert_string_is_neither_NULL_nor_zerolength(mountpoint);
     57    sprintf(output, "%s/archives/%d.star.%s", mountpoint, setno,
     58            bkpinfo->zip_suffix);
     59    if (!does_file_exist(output)) {
     60        sprintf(output, "%s/archives/%d.afio.%s", mountpoint, setno,
     61                bkpinfo->zip_suffix);
     62    }
     63    return (output);
     64}
     65
    3966
    4067/**
     
    116143 * @return The number of sets containing differences (0 for success).
    117144 */
    118 int verify_afioballs_on_CD(struct s_bkpinfo *bkpinfo, char *mountpoint)
     145int verify_afioballs_on_CD(char *mountpoint)
    119146{
    120147
     
    134161         set_number < 9999
    135162         &&
    136          !does_file_exist(vfy_tball_fname
    137                           (bkpinfo, mountpoint, set_number));
     163         !does_file_exist(vfy_tball_fname(mountpoint, set_number));
    138164         set_number++);
    139     if (!does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, set_number))) {
     165    if (!does_file_exist(vfy_tball_fname(mountpoint, set_number))) {
    140166        return (0);
    141167    }
     
    160186
    161187    for (total_sets = set_number;
    162          does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, total_sets));
     188         does_file_exist(vfy_tball_fname(mountpoint, total_sets));
    163189         total_sets++) {
    164190        mr_msg(1, "total_sets = %d", total_sets);
    165191    }
    166192    for (;
    167          does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, set_number));
     193         does_file_exist(vfy_tball_fname(mountpoint, set_number));
    168194         set_number++) {
    169195        percentage =
     
    173199        mr_msg(1, "set = %d", set_number);
    174200        retval +=
    175             verify_an_afioball_from_CD(bkpinfo,
    176                                        vfy_tball_fname(bkpinfo, mountpoint,
    177                                                        set_number));
     201            verify_an_afioball_from_CD(vfy_tball_fname(mountpoint, set_number));
    178202    }
    179203    g_last_afioball_number = set_number - 1;
     
    192216 * @return The number of differences (0 for perfect biggiefiles).
    193217 */
    194 int verify_all_slices_on_CD(struct s_bkpinfo *bkpinfo, char *mtpt)
     218int verify_all_slices_on_CD(char *mtpt)
    195219{
    196220
     
    291315                            bkpinfo->restore_path,
    292316                            biggiestruct.filename);
    293                 mr_asprintf(&tmp, "echo \"%s/%s not found\" >> /tmp/biggies.changed",
     317                mr_asprintf(&tmp, "echo \"%s/%s not found\" >> %s/biggies.changed",
    294318                            bkpinfo->restore_path,
    295                             biggiestruct.filename);
     319                            biggiestruct.filename,
     320                            bkpinfo->tmpdir);
    296321                system(tmp);
    297322                mr_free(tmp);
     
    396421 * @return 0, always.
    397422 */
    398 int verify_a_tarball(struct s_bkpinfo *bkpinfo, char *tarball_fname)
     423int verify_a_tarball(char *tarball_fname)
    399424{
    400425    /*@ buffers ********************************************************* */
     
    522547 */
    523548int
    524 verify_an_afioball_from_CD(struct s_bkpinfo *bkpinfo, char *tarball_fname)
     549verify_an_afioball_from_CD(char *tarball_fname)
    525550{
    526551
     
    528553    int res = 0;
    529554
    530     assert(bkpinfo != NULL);
    531555    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    532556
     
    535559        fatal_error("Cannot verify nonexistent afioball");
    536560    }
    537     res = verify_a_tarball(bkpinfo, tarball_fname);
     561    res = verify_a_tarball(tarball_fname);
    538562    return (res);
    539563}
     
    550574 */
    551575int
    552 verify_an_afioball_from_stream(struct s_bkpinfo *bkpinfo, char *orig_fname,
    553                                long long size)
     576verify_an_afioball_from_stream(char *orig_fname, long long size)
    554577{
    555578
     
    579602
    580603    mr_asprintf(&tarball_fname, "%s/tmpfs/temporary-%s", bkpinfo->tmpdir, p);
    581     read_file_from_stream_to_file(bkpinfo, tarball_fname, size);
    582     res = verify_a_tarball(bkpinfo, tarball_fname);
     604    read_file_from_stream_to_file(tarball_fname, size);
     605    res = verify_a_tarball(tarball_fname);
    583606    if (res) {
    584607        mr_msg(0, "Afioball '%s' no longer matches your live filesystem", p);
     
    599622 */
    600623int
    601 verify_a_biggiefile_from_stream(struct s_bkpinfo *bkpinfo,
    602                                 char *biggie_fname, long long size)
     624verify_a_biggiefile_from_stream(char *biggie_fname, long long size)
    603625{
    604626
     
    642664            wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
    643665        }
    644         res = read_file_from_stream_to_file(bkpinfo, test_file, slice_siz);
     666        res = read_file_from_stream_to_file(test_file, slice_siz);
    645667        unlink(test_file);
    646668        res =
     
    672694            mr_free(tmp);
    673695
    674             mr_asprintf(&tmp, "echo \"%s\" >> /tmp/biggies.changed",
    675                      biggie_fname);
     696            mr_asprintf(&tmp, "echo \"%s\" >> %s/biggies.changed",
     697                    biggie_fname, bkpinfo->tmpdir);
    676698            system(tmp);
    677699            mr_free(tmp);
     
    692714 * @return 0 for success (even if there are differences); nonzero for a tape error.
    693715 */
    694 int verify_afioballs_from_stream(struct s_bkpinfo *bkpinfo)
     716int verify_afioballs_from_stream()
    695717{
    696718    /*@ int ********************************************************** */
     
    722744    }
    723745    log_to_screen(_("Verifying regular archives on tape"));
    724     total_afioballs = get_last_filelist_number(bkpinfo) + 1;
     746    total_afioballs = get_last_filelist_number() + 1;
    725747    open_progress_form(_("Verifying filesystem"),
    726748                       _("I am verifying archives against your live filesystem now."),
     
    733755        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    734756            res =
    735                 read_EXAT_files_from_tape(bkpinfo, &size, fname, &ctrl_chr,
     757                read_EXAT_files_from_tape(&size, fname, &ctrl_chr,
    736758                                          curr_xattr_list_fname,
    737759                                          curr_acl_list_fname);
     
    758780            iamhere("Reading EXAT files from tape");
    759781            res =
    760                 read_EXAT_files_from_tape(bkpinfo, &size, fname, &ctrl_chr,
     782                read_EXAT_files_from_tape(&size, fname, &ctrl_chr,
    761783                                          curr_xattr_list_fname,
    762784                                          curr_acl_list_fname);
     
    772794        mr_free(tmp);
    773795
    774         res = verify_an_afioball_from_stream(bkpinfo, fname, size);
     796        res = verify_an_afioball_from_stream(fname, size);
    775797        if (res) {
    776798            mr_asprintf(&tmp, _("Afioball %ld differs from live filesystem"),
     
    801823 * @return 0 for success (even if there are differences); nonzero for a tape error.
    802824 */
    803 int verify_biggiefiles_from_stream(struct s_bkpinfo *bkpinfo)
     825int verify_biggiefiles_from_stream()
    804826{
    805827
     
    843865            iamhere("Grabbing the EXAT biggiefiles");
    844866            res =
    845                 read_EXAT_files_from_tape(bkpinfo, &size, orig_fname,
     867                read_EXAT_files_from_tape(&size, orig_fname,
    846868                                          &ctrl_chr, curr_xattr_list_fname,
    847869                                          curr_acl_list_fname);
     
    883905                 orig_fname);
    884906        res =
    885             verify_a_biggiefile_from_stream(bkpinfo, logical_fname, size);
     907            verify_a_biggiefile_from_stream(logical_fname, size);
    886908        mr_free(logical_fname);
    887909        retval += res;
     
    911933 * @ingroup verifyGroup
    912934 */
    913 int verify_cd_image(struct s_bkpinfo *bkpinfo)
     935int verify_cd_image()
    914936{
    915937
     
    949971            popup_and_OK(_("Please push CD tray closed."));
    950972        }
    951         if (find_and_mount_actual_cd(bkpinfo, mountpoint)) {
     973        if (find_and_mount_actual_cd(mountpoint)) {
    952974            log_to_screen(_("failed to mount actual CD"));
    953975            return (1);
     
    9981020    mr_free(tmp);
    9991021
    1000     verify_afioballs_on_CD(bkpinfo, mountpoint);
     1022    verify_afioballs_on_CD(mountpoint);
    10011023    iamhere("before verify_all_slices");
    1002     verify_all_slices_on_CD(bkpinfo, mountpoint);
     1024    verify_all_slices_on_CD(mountpoint);
    10031025
    10041026    mr_asprintf(&command, "umount %s", mountpoint);
     
    10451067 * @ingroup verifyGroup
    10461068 */
    1047 int verify_tape_backups(struct s_bkpinfo *bkpinfo)
     1069int verify_tape_backups()
    10481070{
    10491071
     
    10621084    mr_msg(3, "verify_tape_backups --- starting");
    10631085    log_to_screen(_("Verifying backups"));
    1064     openin_tape(bkpinfo);
     1086    openin_tape();
    10651087
    10661088    /* verify archives themselves */
    1067     retval += verify_afioballs_from_stream(bkpinfo);
    1068     retval += verify_biggiefiles_from_stream(bkpinfo);
     1089    retval += verify_afioballs_from_stream();
     1090    retval += verify_biggiefiles_from_stream();
    10691091
    10701092    /* find the final blocks */
    10711093    sync();
    10721094    sleep(2);
    1073     closein_tape(bkpinfo);
     1095    closein_tape();
    10741096
    10751097    /* close tape; exit */
    1076     paranoid_system
    1077         ("rm -f /tmp/biggies.changed /tmp/changed.files.[0-9]* 2> /dev/null");
    1078     mr_asprintf(&changed_files_fname, "/tmp/changed.files.%d",
    1079              (int) (random() % 32767));
     1098    mr_asprintf(&tmp,"rm -f %s/biggies.changed %s/changed.files 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);
     1099    paranoid_system(tmp);
     1100    mr_free(tmp);
     1101
     1102    mr_asprintf(&changed_files_fname, "%s/changed.files", bkpinfo->tmpdir);
    10801103    mr_asprintf(&tmp,
    10811104             "grep -E '^%s:.*$' %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vE '^/afio:.*$' | grep -vE '^dev/.*$'  > %s",
     
    10961119    mr_free(tmp);
    10971120
    1098     mr_asprintf(&tmp, "cat /tmp/biggies.changed >> %s", changed_files_fname);
     1121    mr_asprintf(&tmp, "cat %s/biggies.changed >> %s", bkpinfo->tmpdir, changed_files_fname);
    10991122    paranoid_system(tmp);
    11001123    mr_free(tmp);
     
    11021125    diffs = count_lines_in_file(changed_files_fname);
    11031126    if (diffs > 0) {
    1104         mr_asprintf(&tmp, "cp -f %s %s", changed_files_fname,
    1105                  "/tmp/changed.files");
     1127        mr_asprintf(&tmp, "cp -f %s %s/changed.files", changed_files_fname, MINDI_CACHE);
    11061128        run_program_and_log_output(tmp, FALSE);
    11071129        mr_free(tmp);
    11081130
    11091131        mr_asprintf(&tmp,
    1110                  "%ld files differed from live filesystem; type less %s or less %s to see",
    1111                  diffs, changed_files_fname, "/tmp/changed.files");
     1132                 "%ld files differed from live filesystem; type less %s or less %s/changed.files to see",
     1133                 diffs, changed_files_fname, MINDI_CACHE);
    11121134        mr_msg(0, tmp);
    11131135        mr_free(tmp);
    11141136
    11151137        log_to_screen
    1116             (_("See /tmp/changed.files for a list of nonmatching files."));
     1138            (_("See "MINDI_CACHE"/changed.files for a list of nonmatching files."));
    11171139        log_to_screen
    11181140            (_("The files probably changed on filesystem, not on backup media."));
     
    11241146
    11251147
    1126 /**
    1127  * Generate the filename of a tarball to verify.
    1128  * @param bkpinfo The backup information structure. @c bkpinfo->zip_suffix is the only field used.
    1129  * @param mountpoint The directory where the CD/DVD/ISO is mounted.
    1130  * @param setno The afioball number to get the location of.
    1131  * @return The absolute path to the afioball.
    1132  * @note The returned string points to static data that will be overwritten with each call.
    1133  * @ingroup stringGroup
    1134  */
    1135 char *vfy_tball_fname(struct s_bkpinfo *bkpinfo, char *mountpoint,
    1136                       int setno)
    1137 {
    1138     /*@ buffers ******************************************************* */
    1139     static char output[MAX_STR_LEN];
    1140 
    1141     assert(bkpinfo != NULL);
    1142     assert_string_is_neither_NULL_nor_zerolength(mountpoint);
    1143     sprintf(output, "%s/archives/%d.star.%s", mountpoint, setno,
    1144             bkpinfo->zip_suffix);
    1145     if (!does_file_exist(output)) {
    1146         sprintf(output, "%s/archives/%d.afio.%s", mountpoint, setno,
    1147                 bkpinfo->zip_suffix);
    1148     }
    1149     return (output);
    1150 }
  • branches/stable/mondo/src/common/libmondo-verify.h

    r684 r1663  
    2121
    2222 /** externals *************************************************************/
    23 int close_tape(struct s_bkpinfo *);
     23int close_tape();
    2424extern void close_progress_form(void);
    2525extern long count_lines_in_file(char *);
     
    2727extern void exclude_nonexistent_files(char *);
    2828extern void fatal_error(char *);
    29 extern int find_and_mount_actual_cd(struct s_bkpinfo *, char *);
     29extern int find_and_mount_actual_cd(char *);
    3030extern int find_cdrom_device(char *, bool);
    3131extern void finish(int);
    32 extern int get_last_filelist_number(struct s_bkpinfo *);
     32extern int get_last_filelist_number();
    3333extern long get_time(void);
    3434extern int grab_percentage_from_last_line_of_file(char *);
     
    4040extern void open_evalcall_form(char *);
    4141extern void open_progress_form(char *, char *, char *, char *, long);
    42 extern int openin_tape(struct s_bkpinfo *);
     42extern int openin_tape();
    4343extern void popup_and_OK(char *);
    4444extern bool popup_and_get_string(char *, char *, char *, int);
    45 extern int read_file_from_tape_to_file(struct s_bkpinfo *, char *,
     45extern int read_file_from_tape_to_file(char *,
    4646                                       long long);
    4747extern int read_header_block_from_tape(long long *, char *, int *);
     
    6262
    6363
    64 int verify_cd_image(struct s_bkpinfo *);
    65 int verify_a_tarball(struct s_bkpinfo *, char *);
    66 int verify_an_afioball_from_CD(struct s_bkpinfo *, char *);
    67 int verify_an_afioball_from_tape(struct s_bkpinfo *, char *, long long);
    68 int verify_a_biggiefile_from_tape(struct s_bkpinfo *, char *, long long);
    69 int verify_afioballs_from_CD(struct s_bkpinfo *);
    70 int verify_afioballs_from_tape(struct s_bkpinfo *);
    71 int verify_biggiefiles_from_tape(struct s_bkpinfo *);
    72 int verify_tape_backups(struct s_bkpinfo *);
    73 char *vfy_tball_fname(struct s_bkpinfo *, char *, int);
     64int verify_cd_image();
     65int verify_a_tarball(char *);
     66int verify_an_afioball_from_CD(char *);
     67int verify_an_afioball_from_tape(char *, long long);
     68int verify_a_biggiefile_from_tape(char *, long long);
     69int verify_afioballs_from_CD();
     70int verify_afioballs_from_tape();
     71int verify_biggiefiles_from_tape();
     72int verify_tape_backups();
     73char *vfy_tball_fname(char *, int);
    7474
    7575
     
    9292extern void center_string(char *, int);
    9393extern void close_evalcall_form(void);
    94 extern int closein_tape(struct s_bkpinfo *);
     94extern int closein_tape();
  • branches/stable/mondo/src/common/newt-specific.c

    r1627 r1663  
    12821282                                 char *source_file) {
    12831283    int i;
     1284    int j = 0;
    12841285    bool done;
    12851286    char *tmp = NULL;
     1287    char *tmp1 = NULL;
    12861288    size_t n = 0;
    12871289    FILE *fin = NULL;
     
    12981300        return (1);
    12991301    }
     1302
     1303    asprintf(&tmp1,"%s/icantfindthesefiles.txt",bkpinfo->tmpdir);
     1304    if (!(fout = fopen(tmp1, "a"))) {
     1305        mr_msg(2, "Can't write to %s", tmp1);
     1306        return(1);
     1307    }
     1308
    13001309    mr_msg(2, "Loading %s", source_file);
    13011310    for (filelist->entries = 0; filelist->entries <= ARBITRARY_MAXIMUM;
     
    13161325            goto god_i_hate_gotos;
    13171326        }
    1318         if (!does_file_exist(tmp)) {
     1327        if (!does_file_exist(tmp) && !feof(fin)) {
     1328            fprintf(fout, "%s\n", tmp);
     1329            j++;
    13191330            goto god_i_hate_gotos;
    13201331        }
     
    13291340
    13301341    paranoid_fclose(fin);
     1342    paranoid_fclose(fout);
     1343
     1344    if (j > 0) {
     1345        log_to_screen("%d files listed in %s/changed.files have been deleted since backup was made\nand are referenced in %s", j, bkpinfo->tmpdir,tmp1);
     1346    }
     1347    mr_free(tmp1);
     1348
    13311349    if (filelist->entries >= ARBITRARY_MAXIMUM) {
    13321350        log_to_screen(_("Arbitrary limits suck, man!"));
  • branches/stable/mondo/src/include/my-stuff.h

    r1639 r1663  
    160160 * Log the file, line, Mondo error message, and OS error message (errno).
    161161 */
    162 #define log_OS_error(x) {mr_msg(1, "%s, line %ld: %s (%s)", __FILE__, __LINE__, x, strerror(errno));}
     162#define log_OS_error(x) {mr_msg(1, "%s, (%s)", x, strerror(errno));}
    163163
    164164/**
     
    190190 * Free variables and call finish(@p x).
    191191 */
    192 #define paranoid_MR_finish(x) {free_MR_global_filenames (); if (bkpinfo) mr_free (bkpinfo); finish(x); }
     192#define paranoid_MR_finish(x) {free_MR_global_filenames (); finish(x); }
    193193
    194194/**
  • branches/stable/mondo/src/mondoarchive/mondo-cli-EXT.h

    r1264 r1663  
    11/* mondo-cli-EXT.h */
    22
    3 extern int handle_incoming_parameters(int argc, char *argv[],
    4                                       struct s_bkpinfo *bkpinfo);
    5 extern int process_the_s_switch(struct s_bkpinfo *bkpinfo, char *value);
    6 extern int process_switches(struct s_bkpinfo *bkpinfo,
    7                             char flag_val[128][MAX_STR_LEN],
     3extern int handle_incoming_parameters(int argc, char *argv[]);
     4extern int process_the_s_switch(char *value);
     5extern int process_switches(char flag_val[128][MAX_STR_LEN],
    86                            bool flag_set[128]);
    97extern int retrieve_switches_from_command_line(int argc, char *argv[],
  • 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++;
  • branches/stable/mondo/src/mondoarchive/mondo-cli.h

    r1264 r1663  
    33 */
    44
    5 int handle_incoming_parameters(int argc, char *argv[],
    6                                struct s_bkpinfo *bkpinfo);
    7 int process_the_s_switch(struct s_bkpinfo *bkpinfo, char *value);
    8 int process_switches(struct s_bkpinfo *bkpinfo,
    9                      char flag_val[128][MAX_STR_LEN], bool flag_set[128]);
     5int handle_incoming_parameters(int argc, char *argv[]);
     6int process_the_s_switch(char *value);
     7int process_switches(char flag_val[128][MAX_STR_LEN], bool flag_set[128]);
    108int retrieve_switches_from_command_line(int argc, char *argv[],
    119                                        char flag_val[128][MAX_STR_LEN],
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1639 r1663  
    6262/****************** subroutines used only here ******************/
    6363
     64/* Reference to global bkpinfo */
     65struct s_bkpinfo *bkpinfo;
     66
     67/****************** subroutines used only by main.c ******************/
    6468
    6569/**
     
    386390int main(int argc, char *argv[])
    387391{
    388     struct s_bkpinfo *bkpinfo = NULL;
    389392    struct stat stbuf;
    390393    char *tmp = NULL;
     
    399402#endif
    400403    printf(_("Initializing...\n"));
     404
     405    bkpinfo = mr_malloc(sizeof(struct s_bkpinfo));
     406    reset_bkpinfo();
    401407
    402408    /* Reference a dummy cleanup function for mr_exit temporarily */
     
    463469    malloc_libmondo_global_strings();
    464470    diffs = 0;
    465     bkpinfo = mr_malloc(sizeof(struct s_bkpinfo));
    466471    if (stat(MONDO_CACHE, &stbuf) != 0) {
    467472        mr_mkdir(MONDO_CACHE,0x755);
     
    580585    }
    581586
    582     if (pre_param_configuration(bkpinfo)) {
     587    if (pre_param_configuration()) {
    583588        fatal_error
    584589            ("Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting...");
     
    591596        g_text_mode = FALSE;
    592597        setup_newt_stuff();
    593         res = interactively_obtain_media_parameters_from_user(bkpinfo, TRUE);   /* yes, archiving */
     598        res = interactively_obtain_media_parameters_from_user(TRUE);    /* yes, archiving */
    594599        if (res) {
    595600            fatal_error
     
    597602        }
    598603    } else {
    599         res = handle_incoming_parameters(argc, argv, bkpinfo);
     604        res = handle_incoming_parameters(argc, argv);
    600605        if (res) {
    601606            mr_msg(1,
     
    609614
    610615/* Finish configuring global structures */
    611     if (post_param_configuration(bkpinfo)) {
     616    if (post_param_configuration()) {
    612617        fatal_error
    613618            ("Post-param initialization phase failed. Perhaps bad parameters were supplied to mondoarchive? Please review the documentation, error messages and logs. Exiting...");
     
    622627    /* If we're meant to backup then backup */
    623628    if (bkpinfo->backup_data) {
    624         res = backup_data(bkpinfo);
     629        res = backup_data();
    625630        retval += res;
    626631        if (res) {
     
    634639    /* If we're meant to verify then verify */
    635640    if (bkpinfo->verify_data) {
    636         res = verify_data(bkpinfo);
     641        res = verify_data();
    637642        if (res < 0) {
    638643            mr_asprintf(&say_at_end2, _("%d difference%c found."), -res,
     
    657662    }
    658663
    659 
    660     if (length_of_file("/tmp/changed.files") > 2) {
     664    if (length_of_file(MINDI_CACHE"/changed.files") > 2) {
    661665        if (g_text_mode) {
    662666            log_to_screen
    663                 (_("Type 'less /tmp/changed.files' to see which files don't match the archives"));
     667                (_("Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives"));
    664668        } else {
    665669            mr_msg(1,
    666                     _("Type 'less /tmp/changed.files' to see which files don't match the archives"));
     670                    _("Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives"));
    667671            mr_msg(2, "Calling popup_changelist_from_file()");
    668             popup_changelist_from_file("/tmp/changed.files");
     672            popup_changelist_from_file(MINDI_CACHE"/changed.files");
    669673            mr_msg(2, "Returned from popup_changelist_from_file()");
    670674        }
    671675    } else {
    672         unlink("/tmp/changed.files");
     676        unlink(MINDI_CACHE"/changed.files");
    673677    }
    674678    log_to_screen(say_at_end);
     
    687691
    688692    system("rm -f /var/cache/mondo-archive/last-backup.aborted");
    689     system("rm -Rf /tmp.mondo.* /mondo.scratch.*");
    690693    if (!retval) {
    691694        printf(_("Mondoarchive ran OK.\n"));
     
    698701    chdir("/tmp");              // just in case there's something wrong with g_erase_tmpdir_and_scratchdir
    699702    system(g_erase_tmpdir_and_scratchdir);
     703
     704    /* assemble command string for deletion of Mondo's tmp directory */
     705    sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir);
     706   
    700707    free_libmondo_global_strings();
    701708    mr_free(bkpinfo);
    702 
    703     unlink("/tmp/filelist.full");
    704     unlink("/tmp/filelist.full.gz");
    705709
    706710    if (!g_cdrom_drive_is_here) {
     
    714718    mr_msg(1, "Time finished: %s", mr_date());
    715719    mr_msg_close();
     720
     721    /* remove Mondo's tmp directory */
     722    system(tmp);
     723    paranoid_free(tmp);
    716724
    717725    if (!g_text_mode) {
  • branches/stable/mondo/src/mondorestore/mondo-restore-EXT.h

    r1213 r1663  
    2525
    2626extern void ask_about_these_imagedevs(char *, char *);
    27 extern int catchall_mode(struct s_bkpinfo *, struct mountlist_itself *,
     27extern int catchall_mode(struct mountlist_itself *,
    2828                         struct raidlist_itself *);
    2929extern void sort_mountlist_by_device(struct mountlist_itself *);
    30 extern int interactive_mode(struct s_bkpinfo *, struct mountlist_itself *,
     30extern int interactive_mode(struct mountlist_itself *,
    3131                            struct raidlist_itself *);
    32 extern int nuke_mode(struct s_bkpinfo *, struct mountlist_itself *,
     32extern int nuke_mode(struct mountlist_itself *,
    3333                     struct raidlist_itself *);
    34 extern int compare_mode(struct s_bkpinfo *, struct mountlist_itself *,
     34extern int compare_mode(struct mountlist_itself *,
    3535                        struct raidlist_itself *);
    36 extern int iso_mode(struct s_bkpinfo *bkpinfo,
     36extern int iso_mode(
    3737                    struct mountlist_itself *mountlist,
    3838                    struct raidlist_itself *raidlist, bool nuke_me_please);
    3939extern int load_mountlist(struct mountlist_itself *, char *);
    4040extern int load_raidtab_into_raidlist(struct raidlist_itself *, char *);
    41 extern int restore_mode(struct s_bkpinfo *, struct mountlist_itself *,
     41extern int restore_mode(struct mountlist_itself *,
    4242                        struct raidlist_itself *);
    4343extern int save_raidlist_to_raidtab(struct raidlist_itself *, char *);
    4444extern void process_raidtab_line(FILE *, struct raid_device_record *,
    4545                                 char *, char *);
    46 extern int restore_a_biggiefile_from_CD(struct s_bkpinfo *, long,
     46extern int restore_a_biggiefile_from_CD(long,
    4747                                        struct s_node *);
    48 extern int restore_a_biggiefile_from_stream(struct s_bkpinfo *, char *,
     48extern int restore_a_biggiefile_from_stream(char *,
    4949                                            long, char *, long long,
    5050                                            struct s_node *);
    5151extern int restore_a_tarball_from_CD(char *, int, struct s_node *, struct s_bkpinfo *);
    52 extern int restore_a_tarball_from_stream(struct s_bkpinfo *, char *, int,
     52extern int restore_a_tarball_from_stream(char *, int,
    5353                                         struct s_node *, long long);
    54 extern int restore_all_biggiefiles_from_CD(struct s_bkpinfo *,
     54extern int restore_all_biggiefiles_from_CD(
    5555                                           struct s_node *);
    56 extern int restore_all_biggiefiles_from_stream(struct s_bkpinfo *,
     56extern int restore_all_biggiefiles_from_stream(
    5757                                               struct s_node *);
    58 extern int restore_all_tarballs_from_CD(struct s_bkpinfo *,
     58extern int restore_all_tarballs_from_CD(
    5959                                        struct s_node *);
    60 extern int restore_all_tarballs_from_stream(struct s_bkpinfo *,
     60extern int restore_all_tarballs_from_stream(
    6161                                            struct s_node *);
    62 extern int restore_everything(struct s_bkpinfo *, struct s_node *);
    63 extern int restore_live_from_monitas_server(struct s_bkpinfo *, char *,
     62extern int restore_everything(struct s_node *);
     63extern int restore_live_from_monitas_server(char *,
    6464                                            char *, char *);
    65 extern int restore_to_live_filesystem(struct s_bkpinfo *);
     65extern int restore_to_live_filesystem();
    6666extern void swap_mountlist_entries(struct mountlist_itself *, int, int);
    6767extern void sort_mountlist_by_mountpoint(struct mountlist_itself *, bool);
     
    7474extern int save_raidlist_to_raidtab(struct raidlist_itself *raidlist,
    7575                                    char *fname);
    76 extern int what_number_cd_is_this(struct s_bkpinfo *);
     76extern int what_number_cd_is_this();
    7777
    7878#ifdef __FreeBSD__
  • branches/stable/mondo/src/mondorestore/mondo-restore.h

    r1200 r1663  
    88
    99void ask_about_these_imagedevs(char *, char *);
    10 int catchall_mode(struct s_bkpinfo *, struct mountlist_itself *,
     10int catchall_mode(struct mountlist_itself *,
    1111                  struct raidlist_itself *);
    12 int interactive_mode(struct s_bkpinfo *, struct mountlist_itself *,
     12int interactive_mode(struct mountlist_itself *,
    1313                     struct raidlist_itself *);
    14 int nuke_mode(struct s_bkpinfo *, struct mountlist_itself *,
     14int nuke_mode(struct mountlist_itself *,
    1515              struct raidlist_itself *);
    16 int compare_mode(struct s_bkpinfo *, struct mountlist_itself *,
     16int compare_mode(struct mountlist_itself *,
    1717                 struct raidlist_itself *);
    18 int iso_mode(struct s_bkpinfo *bkpinfo, struct mountlist_itself *mountlist,
     18int iso_mode(struct mountlist_itself *mountlist,
    1919             struct raidlist_itself *raidlist, bool nuke_me_please);
    20 int restore_mode(struct s_bkpinfo *, struct mountlist_itself *,
     20int restore_mode(struct mountlist_itself *,
    2121                 struct raidlist_itself *);
    22 int restore_a_biggiefile_from_CD(struct s_bkpinfo *, long, struct s_node *,
     22int restore_a_biggiefile_from_CD(long, struct s_node *,
    2323                                 char *);
    24 int restore_a_biggiefile_from_stream(struct s_bkpinfo *, char *, long,
     24int restore_a_biggiefile_from_stream(char *, long,
    2525                                     char *, long long, struct s_node *,
    2626                                     int, char *);
    2727int restore_a_tarball_from_CD(char *, long, struct s_node *, struct s_bkpinfo *);
    28 int restore_a_tarball_from_stream(struct s_bkpinfo *, char *, long,
     28int restore_a_tarball_from_stream(char *, long,
    2929                                  struct s_node *, long long, char *,
    3030                                  char *);
    31 int restore_all_biggiefiles_from_CD(struct s_bkpinfo *, struct s_node *);
    32 int restore_all_biggiefiles_from_stream(struct s_bkpinfo *,
     31int restore_all_biggiefiles_from_CD(struct s_node *);
     32int restore_all_biggiefiles_from_stream(
    3333                                        struct s_node *);
    34 int restore_all_tarballs_from_CD(struct s_bkpinfo *, struct s_node *);
    35 int restore_all_tarballs_from_stream(struct s_bkpinfo *, struct s_node *);
    36 int restore_everything(struct s_bkpinfo *, struct s_node *);
    37 int restore_live_from_monitas_server(struct s_bkpinfo *, char *, char *,
     34int restore_all_tarballs_from_CD(struct s_node *);
     35int restore_all_tarballs_from_stream(struct s_node *);
     36int restore_everything(struct s_node *);
     37int restore_live_from_monitas_server(char *, char *,
    3838                                     char *);
    39 int restore_to_live_filesystem(struct s_bkpinfo *);
     39int restore_to_live_filesystem();
    4040void swap_mountlist_entries(struct mountlist_itself *, int, int);
    4141void sort_mountlist_by_mountpoint(struct mountlist_itself *, bool);
    4242void sort_mountlist_by_device(struct mountlist_itself *);
    43 int what_number_cd_is_this(struct s_bkpinfo *);
     43int what_number_cd_is_this();
  • branches/stable/mondo/src/mondorestore/mondo-rstr-compare-EXT.h

    r1200 r1663  
    44
    55
    6 extern int compare_to_CD(struct s_bkpinfo *);
    7 extern int compare_to_cdstream(struct s_bkpinfo *);
    8 extern int compare_to_tape(struct s_bkpinfo *);
    9 extern int compare_mode(struct s_bkpinfo *bkpinfo,
    10                         struct mountlist_itself *mountlist,
     6extern int compare_to_CD();
     7extern int compare_to_cdstream();
     8extern int compare_to_tape();
     9extern int compare_mode(struct mountlist_itself *mountlist,
    1110                        struct raidlist_itself *raidlist);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c

    r1638 r1663  
    1919extern char *MONDO_LOGFILE;
    2020
     21/* Reference to global bkpinfo */
     22extern struct s_bkpinfo *bkpinfo;
     23
    2124//static char cvsid[] = "$Id$";
    2225
     
    3437 * @note This function uses an MD5 checksum.
    3538 */
    36 int compare_a_biggiefile(struct s_bkpinfo *bkpinfo, long bigfileno)
     39int compare_a_biggiefile(long bigfileno)
    3740{
    3841
     
    5861    if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) {
    5962        if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
    60             insist_on_this_cd_number(bkpinfo, (++g_current_media_number));
     63            insist_on_this_cd_number((++g_current_media_number));
    6164        } else {
    6265            mr_msg(2, "No CD's left. No biggiefiles left. No problem.");
     
    133136
    134137    if (retval) {
    135         if (!(fout = fopen("/tmp/changed.txt", "a"))) {
     138        if (!(fout = fopen(MINDI_CACHE"/changed.txt", "a"))) {
    136139            fatal_error("Cannot openout changed.txt");
    137140        }
     
    151154/**
    152155 * Compare all biggiefiles in the backup.
    153  * @param bkpinfo The backup information structure. Used only in compare_a_biggiefile().
    154156 * @return 0 for success, nonzero for failure.
    155157 */
    156 int compare_all_biggiefiles(struct s_bkpinfo *bkpinfo)
     158int compare_all_biggiefiles()
    157159{
    158160    int retval = 0;
     
    161163    char *tmp = NULL;
    162164
    163     assert(bkpinfo != NULL);
    164165    mr_msg(1, "Comparing biggiefiles");
    165166
     
    187188        mr_free(tmp);
    188189
    189         res = compare_a_biggiefile(bkpinfo, bigfileno);
     190        res = compare_a_biggiefile(bigfileno);
    190191        retval += res;
    191192        g_current_progress++;
     
    303304    if (length_of_file(logfile) > 5) {
    304305        mr_asprintf(&command,
    305                 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> /tmp/changed.txt",
     306                "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MINDI_CACHE"/changed.txt",
    306307                logfile);
    307308        system(command);
     
    330331 * @return 0 for success, nonzero for failure.
    331332 */
    332 int compare_all_tarballs(struct s_bkpinfo *bkpinfo)
     333int compare_all_tarballs()
    333334{
    334335    int retval = 0;
     
    361362
    362363    for (;;) {
    363         insist_on_this_cd_number(bkpinfo, g_current_media_number);
     364        insist_on_this_cd_number(g_current_media_number);
    364365        update_progress_form(progress_str);
    365366        mr_asprintf(&tarball_fname,
     
    441442 * @return 0 for success, nonzero for failure.
    442443 */
    443 int compare_to_CD(struct s_bkpinfo *bkpinfo)
     444int compare_to_CD()
    444445{
    445446  /** needs malloc *********/
     
    460461    chdir(bkpinfo->restore_path);
    461462    getcwd(new, MAX_STR_LEN - 1);
    462     insist_on_this_cd_number(bkpinfo, g_current_media_number);
    463     unlink("/tmp/changed.txt");
    464 
    465     resA = compare_all_tarballs(bkpinfo);
    466     resB = compare_all_biggiefiles(bkpinfo);
     463    insist_on_this_cd_number(g_current_media_number);
     464    unlink(MINDI_CACHE"/changed.txt");
     465
     466    resA = compare_all_tarballs();
     467    resB = compare_all_biggiefiles();
    467468    chdir(cwd);
    468     noof_changed_files = count_lines_in_file("/tmp/changed.txt");
     469    noof_changed_files = count_lines_in_file(MINDI_CACHE"/changed.txt");
    469470    if (noof_changed_files) {
    470471        log_to_screen(_("%ld files do not match the backup            "),
    471472                noof_changed_files);
    472         mr_asprintf(&command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE);
     473        mr_asprintf(&command, "cat "MINDI_CACHE"/changed.txt >> %s", MONDO_LOGFILE);
    473474        paranoid_system(command);
    474475        mr_free(command);
     
    501502 */
    502503int
    503 compare_mode(struct s_bkpinfo *bkpinfo,
    504              struct mountlist_itself *mountlist,
     504compare_mode(struct mountlist_itself *mountlist,
    505505             struct raidlist_itself *raidlist)
    506506{
     
    522522    assert(raidlist != NULL);
    523523
    524     while (get_cfg_file_from_archive(bkpinfo)) {
     524    while (get_cfg_file_from_archive()) {
    525525        if (!ask_me_yes_or_no
    526526            (_
     
    529529            fatal_error("Unable to find config file/archives. Aborting.");
    530530        }
    531         interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
    532     }
    533 
    534     read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     531        interactively_obtain_media_parameters_from_user(FALSE);
     532    }
     533
     534    read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    535535    g_current_media_number = 1;
    536536    mvaddstr_and_log_it(1, 30, _("Comparing Automatically"));
     
    544544    if (bkpinfo->backup_media_type == tape
    545545        || bkpinfo->backup_media_type == udev) {
    546         retval += compare_to_tape(bkpinfo);
     546        retval += compare_to_tape();
    547547    } else if (bkpinfo->backup_media_type == cdstream) {
    548         retval += compare_to_cdstream(bkpinfo);
    549     } else {
    550         retval += compare_to_CD(bkpinfo);
     548        retval += compare_to_cdstream();
     549    } else {
     550        retval += compare_to_CD();
    551551    }
    552552    if (retval) {
     
    557557    }
    558558
    559     if (count_lines_in_file("/tmp/changed.txt") > 0) {
     559    if (count_lines_in_file(MINDI_CACHE"/changed.txt") > 0) {
    560560        mvaddstr_and_log_it(g_currentY++, 0,
    561561                            _
    562562                            ("Differences found while files were being compared."));
    563         streamline_changes_file("/tmp/changed.files", "/tmp/changed.txt");
    564         if (count_lines_in_file("/tmp/changed.files") <= 0) {
     563        streamline_changes_file(MINDI_CACHE"/changed.files", MINDI_CACHE"/changed.txt");
     564        if (count_lines_in_file(MINDI_CACHE"/changed.files") <= 0) {
    565565            mvaddstr_and_log_it(g_currentY++, 0,
    566566                                _
     
    569569                          ("The differences were logfiles and temporary files. Your archives are fine."));
    570570        } else {
    571             q = count_lines_in_file("/tmp/changed.files");
     571            q = count_lines_in_file(MINDI_CACHE"/changed.files");
    572572            mr_asprintf(&tmp, _("%ld significant difference%s found."), q,
    573573                    (q != 1) ? "s" : "");
     
    586586            chdir(bkpinfo->restore_path);
    587587            getcwd(new, MAX_STR_LEN - 1);
    588             popup_changelist_from_file("/tmp/changed.files");
     588            popup_changelist_from_file(MINDI_CACHE"/changed.files");
    589589            mr_msg(2, "Returning from popup_changelist_from_file()");
    590590            chdir(cwd);
     
    616616 * @return 0 for success, nonzero for failure.
    617617 */
    618 int compare_to_cdstream(struct s_bkpinfo *bkpinfo)
     618int compare_to_cdstream()
    619619{
    620620    int res;
     
    642642               last_line_of_file("/tmp/CDROM-LIVES-HERE"));
    643643    }
    644     res = verify_tape_backups(bkpinfo);
     644    res = verify_tape_backups();
    645645    chdir(dir);
    646     if (length_of_file("/tmp/changed.txt") > 2
    647         && length_of_file("/tmp/changed.files") > 2) {
     646    if (length_of_file(MINDI_CACHE"/changed.txt") > 2
     647        && length_of_file(MINDI_CACHE"/changed.files") > 2) {
    648648        mr_msg(0,
    649                 "Type 'less /tmp/changed.files' to see which files don't match the archives");
     649                "Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives");
    650650        mr_msg(2, "Calling popup_changelist_from_file()");
    651         popup_changelist_from_file("/tmp/changed.files");
     651        popup_changelist_from_file(MINDI_CACHE"/changed.files");
    652652        mr_msg(2, "Returned from popup_changelist_from_file()");
    653653    }
     
    674674 * returns: int                                                           *
    675675 **************************************************************************/
    676 int compare_to_tape(struct s_bkpinfo *bkpinfo)
     676int compare_to_tape()
    677677{
    678678    int res = 0;
     
    692692    mvaddstr_and_log_it(g_currentY,
    693693                        0, _("Verifying archives against filesystem"));
    694     res = verify_tape_backups(bkpinfo);
     694    res = verify_tape_backups();
    695695    chdir(dir);
    696696    if (res) {
  • branches/stable/mondo/src/mondorestore/mondo-rstr-compare.h

    r1200 r1663  
    44
    55
    6 int compare_to_CD(struct s_bkpinfo *);
    7 int compare_to_cdstream(struct s_bkpinfo *);
    8 int compare_to_tape(struct s_bkpinfo *);
     6int compare_to_CD();
     7int compare_to_cdstream();
     8int compare_to_tape();
    99
    1010int
    11 compare_mode(struct s_bkpinfo *bkpinfo,
    12              struct mountlist_itself *mountlist,
     11compare_mode(struct mountlist_itself *mountlist,
    1312             struct raidlist_itself *raidlist);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-newt.c

    r1555 r1663  
    2626
    2727extern char err_log_lines[NOOF_ERR_LINES][MAX_STR_LEN];
    28 
    2928
    3029/**
  • branches/stable/mondo/src/mondorestore/mondo-rstr-newt.h

    r1297 r1663  
    4343extern struct s_node *find_node_in_filelist(struct s_node *,
    4444                                            char *filename);
    45 extern int what_number_cd_is_this(struct s_bkpinfo *);
     45extern int what_number_cd_is_this();
    4646//extern void fatal_error (char *);
    4747extern void sort_mountlist_by_device(struct mountlist_itself *);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools-EXT.h

    r1580 r1663  
    44
    55extern void free_MR_global_filenames(void);
    6 extern void get_cfg_file_from_archive_or_bust(struct s_bkpinfo *);
     6extern void get_cfg_file_from_archive_or_bust();
    77extern bool is_file_in_list(char *, char *, char *);    /* needle, haystack, preamble */
    8 extern int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please);
     8extern int iso_fiddly_bits(bool nuke_me_please);
    99extern void kill_petris(void);
    10 extern int mount_cdrom(struct s_bkpinfo *bkpinfo);
     10extern int mount_cdrom();
    1111extern int mount_all_devices(struct mountlist_itself *, bool);
    1212extern void protect_against_braindead_sysadmins(void);
    13 extern int read_cfg_file_into_bkpinfo(char *cfg_file,
    14                                       struct s_bkpinfo *bkpinfo);
    15 struct s_node *process_filelist_and_biggielist(struct s_bkpinfo *);
     13extern int read_cfg_file_into_bkpinfo(char *cfg_file);
     14struct s_node *process_filelist_and_biggielist();
    1615extern int backup_crucial_file(char *path_root, char *filename);
    1716extern int run_boot_loader(bool);
     
    2423extern void streamline_changes_file(char *, char *);
    2524extern void set_signals(int on);
    26 extern void setup_MR_global_filenames(struct s_bkpinfo *bkpinfo);
     25extern void setup_MR_global_filenames();
    2726extern void terminate_daemon(int);
    2827extern void termination_in_progress(int);
    2928extern int unmount_all_devices(struct mountlist_itself *);
    30 extern int get_cfg_file_from_archive(struct s_bkpinfo *bkpinfo);
     29extern int get_cfg_file_from_archive();
    3130extern int
    32 extract_config_file_from_ramdisk(struct s_bkpinfo *bkpinfo,
     31extract_config_file_from_ramdisk(
    3332                                 char *ramdisk_fname,
    3433                                 char *output_cfg_file,
  • 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        }
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.h

    r1580 r1663  
    44
    55void free_global_filenames(void);
    6 void get_cfg_file_from_archive_or_bust(struct s_bkpinfo *);
     6void get_cfg_file_from_archive_or_bust();
    77bool is_file_in_list(char *, char *, char *);   /* needle, haystack, preamble */
    8 int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please);
     8int iso_fiddly_bits(bool nuke_me_please);
    99void kill_petris(void);
    10 int mount_cdrom(struct s_bkpinfo *bkpinfo);
     10int mount_cdrom();
    1111int mount_device(char *, char *, char *, bool);
    1212int mount_all_devices(struct mountlist_itself *, bool);
    1313void protect_against_braindead_sysadmins(void);
    14 int read_cfg_file_into_bkpinfo(char *cfg_file, struct s_bkpinfo *bkpinfo);
    15 struct s_node *process_filelist_and_biggielist(struct s_bkpinfo *);
     14int read_cfg_file_into_bkpinfo(char *cfg_file);
     15struct s_node *process_filelist_and_biggielist();
    1616int backup_crucial_file(char *path_root, char *filename);
    1717
     
    2424void streamline_changes_file(char *, char *);
    2525void set_signals(int on);
    26 void setup_global_filenames(struct s_bkpinfo *bkpinfo);
     26void setup_global_filenames();
    2727void twenty_seconds_til_yikes(void);
    2828int run_raw_mbr(bool offer_to_hack_scripts, char *bd);
     
    3030void termination_in_progress(int);
    3131int unmount_all_devices(struct mountlist_itself *);
    32 int get_cfg_file_from_archive(struct s_bkpinfo *bkpinfo);
     32int get_cfg_file_from_archive();
    3333void ask_about_these_imagedevs(char *infname, char *outfname);
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1639 r1663  
    3535
    3636extern void twenty_seconds_til_yikes(void);
     37
     38/* Reference to global bkpinfo */
     39struct s_bkpinfo *bkpinfo;
    3740
    3841/* For use in other programs (ex. XMondo) */
     
    205208 * @ingroup restoreGuiGroup
    206209 */
    207 int let_user_edit_the_mountlist(struct s_bkpinfo *bkpinfo,
    208                                 struct mountlist_itself *mountlist,
     210int let_user_edit_the_mountlist(struct mountlist_itself *mountlist,
    209211                                struct raidlist_itself *raidlist)
    210212{
     
    306308 */
    307309int
    308 catchall_mode(struct s_bkpinfo *bkpinfo,
    309               struct mountlist_itself *mountlist,
     310catchall_mode(struct mountlist_itself *mountlist,
    310311              struct raidlist_itself *raidlist)
    311312{
     
    321322    iamhere("post wrm");
    322323    if (c == 'I' || c == 'N' || c == 'C') {
    323         interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
     324        interactively_obtain_media_parameters_from_user(FALSE);
    324325    } else {
    325326        popup_and_OK(_("No restoring or comparing will take place today."));
     
    338339
    339340    if (bkpinfo->backup_media_type == iso) {
    340         if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) {
     341        if (iso_fiddly_bits((c == 'N') ? TRUE : FALSE)) {
    341342            mr_msg(2,
    342343                    "catchall_mode --- iso_fiddly_bits returned w/ error");
     
    349350    if (c == 'I') {
    350351        mr_msg(2, "IM selected");
    351         retval += interactive_mode(bkpinfo, mountlist, raidlist);
     352        retval += interactive_mode(mountlist, raidlist);
    352353    } else if (c == 'N') {
    353354        mr_msg(2, "NM selected");
    354         retval += nuke_mode(bkpinfo, mountlist, raidlist);
     355        retval += nuke_mode(mountlist, raidlist);
    355356    } else if (c == 'C') {
    356357        mr_msg(2, "CM selected");
    357         retval += compare_mode(bkpinfo, mountlist, raidlist);
     358        retval += compare_mode(mountlist, raidlist);
    358359    }
    359360    return (retval);
     
    368369 **************************************************************************/
    369370
    370 static void clean_blkid(struct s_bkpinfo *bkpinfo) {
     371static void clean_blkid() {
    371372
    372373    char *tmp1 = NULL;
     
    396397 */
    397398int
    398 interactive_mode(struct s_bkpinfo *bkpinfo,
    399                  struct mountlist_itself *mountlist,
     399interactive_mode(struct mountlist_itself *mountlist,
    400400                 struct raidlist_itself *raidlist)
    401401{
     
    434434
    435435    iamhere("About to load config file");
    436     get_cfg_file_from_archive_or_bust(bkpinfo);
    437     read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     436    get_cfg_file_from_archive_or_bust();
     437    read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    438438    iamhere("Done loading config file; resizing ML");
    439439    mr_asprintf(&tmp,bkpinfo->prefix);
     
    560560    {
    561561        mr_msg(1, "Restoring all data");
    562         retval += restore_everything(bkpinfo, NULL);
     562        retval += restore_everything(NULL);
    563563    } else if ((restore_all =
    564564             ask_me_yes_or_no
     
    567567        for (done = FALSE; !done;) {
    568568            unlink("/tmp/filelist.full");
    569             filelist = process_filelist_and_biggielist(bkpinfo);
     569            filelist = process_filelist_and_biggielist();
    570570            /* Now you have /tmp/tmpfs/filelist.restore-these and /tmp/tmpfs/biggielist.restore-these;
    571571               the former is a list of regular files; the latter, biggiefiles and imagedevs.
     
    587587                    strcpy(bkpinfo->restore_path, tmp1);
    588588                    mr_msg(1, "Restoring subset");
    589                     retval += restore_everything(bkpinfo, filelist);
     589                    retval += restore_everything(filelist);
    590590                    free_filelist(filelist);
    591591                } else {
     
    622622    }
    623623
    624     clean_blkid(bkpinfo);
     624    clean_blkid();
    625625    protect_against_braindead_sysadmins();
    626626    retval += unmount_all_devices(mountlist);
     
    671671 * Run an arbitrary restore mode (prompt the user), but from ISO images
    672672 * instead of real media.
    673  * @param bkpinfo The backup information structure. Most fields are used.
    674673 * @param mountlist The mountlist containing information about the user's partitions.
    675674 * @param raidlist The raidlist that goes with @p mountlist.
     
    678677 */
    679678int
    680 iso_mode(struct s_bkpinfo *bkpinfo,
    681          struct mountlist_itself *mountlist,
     679iso_mode(struct mountlist_itself *mountlist,
    682680         struct raidlist_itself *raidlist, bool nuke_me_please)
    683681{
     
    685683    int retval = 0;
    686684
    687     assert(bkpinfo != NULL);
    688685    assert(mountlist != NULL);
    689686    assert(raidlist != NULL);
    690     if (iso_fiddly_bits(bkpinfo, nuke_me_please)) {
     687    if (iso_fiddly_bits(nuke_me_please)) {
    691688        mr_msg(1, "iso_mode --- returning w/ error");
    692689        return (1);
     
    694691        c = which_restore_mode();
    695692        if (c == 'I' || c == 'N' || c == 'C') {
    696             interactively_obtain_media_parameters_from_user(bkpinfo,
    697                                                             FALSE);
     693            interactively_obtain_media_parameters_from_user(FALSE);
    698694        }
    699695        if (c == 'I') {
    700             retval += interactive_mode(bkpinfo, mountlist, raidlist);
     696            retval += interactive_mode(mountlist, raidlist);
    701697        } else if (c == 'N') {
    702             retval += nuke_mode(bkpinfo, mountlist, raidlist);
     698            retval += nuke_mode(mountlist, raidlist);
    703699        } else if (c == 'C') {
    704             retval += compare_mode(bkpinfo, mountlist, raidlist);
     700            retval += compare_mode(mountlist, raidlist);
    705701        } else {
    706702            log_to_screen(_("OK, I shan't restore/compare any files."));
     
    761757 */
    762758int
    763 nuke_mode(struct s_bkpinfo *bkpinfo,
    764           struct mountlist_itself *mountlist,
     759nuke_mode(struct mountlist_itself *mountlist,
    765760          struct raidlist_itself *raidlist)
    766761{
     
    778773    mr_msg(2, "nuke_mode --- starting");
    779774
    780     get_cfg_file_from_archive_or_bust(bkpinfo);
     775    get_cfg_file_from_archive_or_bust();
    781776    load_mountlist(mountlist, g_mountlist_fname);   // in case read_cfg_file_into_bkpinfo updated the mountlist
    782777#ifdef __FreeBSD__
     
    796791        if (ask_me_yes_or_no(tmp)) {
    797792            mr_free(tmp);
    798             retval = interactive_mode(bkpinfo, mountlist, raidlist);
     793            retval = interactive_mode(mountlist, raidlist);
    799794            call_me_after_the_nuke(retval);
    800795            return(retval);
     
    852847
    853848        if (ask_me_yes_or_no(_("Try in interactive mode instead?"))) {
    854             retval = interactive_mode(bkpinfo, mountlist, raidlist);
     849            retval = interactive_mode(mountlist, raidlist);
    855850            call_me_after_the_nuke(retval);
    856851            return(retval);
     
    869864    }
    870865    iamhere("Restoring everything");
    871     retval += restore_everything(bkpinfo, NULL);
     866    retval += restore_everything(NULL);
    872867    if (!run_boot_loader(FALSE)) {
    873868        mr_msg(1,
     
    875870        boot_loader_installed = TRUE;
    876871    }
    877     clean_blkid(bkpinfo);
     872    clean_blkid();
    878873    protect_against_braindead_sysadmins();
    879874    retval += unmount_all_devices(mountlist);
     
    910905 * @return 0 for success, or the number of errors encountered.
    911906 */
    912 int restore_to_live_filesystem(struct s_bkpinfo *bkpinfo)
     907int restore_to_live_filesystem()
    913908{
    914909    int retval = 0;
     
    932927        sleep(1);
    933928    }
    934     interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
     929    interactively_obtain_media_parameters_from_user(FALSE);
    935930    if (!bkpinfo->media_device) {
    936931        mr_msg(2, "Warning - failed to find media dev");
     
    944939    open_evalcall_form(_("Thinking..."));
    945940
    946     get_cfg_file_from_archive_or_bust(bkpinfo);
    947     read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     941    get_cfg_file_from_archive_or_bust();
     942    read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    948943    load_mountlist(mountlist, g_mountlist_fname);   // in case read_cfg_file_into_bkpinfo
    949944
     
    951946    retval = load_mountlist(mountlist, g_mountlist_fname);
    952947    load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    953     filelist = process_filelist_and_biggielist(bkpinfo);
     948    filelist = process_filelist_and_biggielist();
    954949    if (filelist) {
    955950        save_filelist(filelist, "/tmp/selected-files.txt");
     
    959954                                 bkpinfo->restore_path, MAX_STR_LEN)) {
    960955            iamhere("Restoring everything");
    961             retval += restore_everything(bkpinfo, filelist);
     956            retval += restore_everything(filelist);
    962957        }
    963958        free_filelist(filelist);
     
    10061001 */
    10071002int
    1008 restore_a_biggiefile_from_CD(struct s_bkpinfo *bkpinfo,
    1009                              long bigfileno,
     1003restore_a_biggiefile_from_CD(long bigfileno,
    10101004                             struct s_node *filelist,
    10111005                             char *pathname_of_last_file_restored)
     
    11781172                    bkpinfo->backup_media_string,
    11791173                    g_current_media_number);
    1180             insist_on_this_cd_number(bkpinfo, g_current_media_number);
     1174            insist_on_this_cd_number(g_current_media_number);
    11811175            log_to_screen(_("Continuing to restore."));
    11821176        } else {
     
    13071301 * @return 0 for success (or skip), nonzero for failure.
    13081302 */
    1309 int restore_a_biggiefile_from_stream(struct s_bkpinfo *bkpinfo, char *orig_bf_fname, long biggiefile_number, char *orig_checksum,   //UNUSED
     1303int restore_a_biggiefile_from_stream(char *orig_bf_fname, long biggiefile_number, char *orig_checksum,  //UNUSED
    13101304                                     long long biggiefile_size, //UNUSED
    13111305                                     struct s_node *filelist,
     
    14741468        if (current_slice_number == 0) {
    14751469            res =
    1476                 read_file_from_stream_to_file(bkpinfo,
    1477                                               "/tmp/biggie-blah.txt",
     1470                read_file_from_stream_to_file("/tmp/biggie-blah.txt",
    14781471                                              slice_siz);
    14791472            if (!(fin = fopen("/tmp/biggie-blah.txt", "r"))) {
     
    14911484        } else {
    14921485            res =
    1493                 read_file_from_stream_to_stream(bkpinfo, pout, slice_siz);
     1486                read_file_from_stream_to_stream(pout, slice_siz);
    14941487        }
    14951488        retval += res;
     
    17761769 */
    17771770int
    1778 restore_a_tarball_from_stream(struct s_bkpinfo *bkpinfo,
    1779                               char *tarball_fname,
     1771restore_a_tarball_from_stream(char *tarball_fname,
    17801772                              long current_tarball_number,
    17811773                              struct s_node *filelist,
     
    18171809    mr_asprintf(&filelist_subset_fname, "%s/filelist-subset-%ld.tmp",
    18181810            bkpinfo->tmpdir, current_tarball_number);
    1819     res = read_file_from_stream_to_file(bkpinfo, afio_fname, size);
     1811    res = read_file_from_stream_to_file(afio_fname, size);
    18201812    if (strstr(tarball_fname, ".star")) {
    18211813        bkpinfo->use_star = TRUE;
     
    19511943 */
    19521944int
    1953 restore_all_biggiefiles_from_CD(struct s_bkpinfo *bkpinfo,
    1954                                 struct s_node *filelist)
     1945restore_all_biggiefiles_from_CD(struct s_node *filelist)
    19551946{
    19561947    int retval = 0;
     
    20182009                        "I'll continue to scan this CD for bigfiles to be restored.");
    20192010            } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
    2020                 insist_on_this_cd_number(bkpinfo,
    2021                                          ++g_current_media_number);
     2011                insist_on_this_cd_number(++g_current_media_number);
    20222012                log_to_screen(_("Restoring from %s #%d"),
    2023                         bkpinfo->backup_media_string,
     2013                        media_descriptor_string(bkpinfo->backup_media_type),
    20242014                        g_current_media_number);
    20252015                just_changed_cds = TRUE;
     
    20372027
    20382028            res =
    2039                 restore_a_biggiefile_from_CD(bkpinfo, bigfileno, filelist,
    2040                                              pathname_of_last_biggie_restored);
     2029                restore_a_biggiefile_from_CD(bigfileno, filelist, pathname_of_last_biggie_restored);
    20412030            iamhere(pathname_of_last_biggie_restored);
    20422031            if (fbw && pathname_of_last_biggie_restored[0]) {
     
    20972086 */
    20982087int
    2099 restore_all_tarballs_from_CD(struct s_bkpinfo *bkpinfo,
    2100                              struct s_node *filelist)
     2088restore_all_tarballs_from_CD(struct s_node *filelist)
    21012089{
    21022090    int retval = 0;
     
    21262114        g_current_media_number = 1;
    21272115    }
    2128     insist_on_this_cd_number(bkpinfo, g_current_media_number);
     2116    insist_on_this_cd_number(g_current_media_number);
    21292117    read_cfg_var(g_mondo_cfg_file, "last-filelist-number", tmp1);
    21302118    max_val = atol(tmp1) + 1;
     
    21402128                       progress_str, max_val);
    21412129    for (;;) {
    2142         insist_on_this_cd_number(bkpinfo, g_current_media_number);
     2130        insist_on_this_cd_number(g_current_media_number);
    21432131        update_progress_form(progress_str);
    21442132        mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%ld.afio.bz2",
     
    22522240 */
    22532241int
    2254 restore_all_biggiefiles_from_stream(struct s_bkpinfo *bkpinfo,
    2255                                     struct s_node *filelist)
     2242restore_all_biggiefiles_from_stream(struct s_node *filelist)
    22562243{
    22572244    long noof_biggiefiles = 0L;
     
    23062293    if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    23072294        res =
    2308             read_EXAT_files_from_tape(bkpinfo, &biggie_size, biggie_fname,
     2295            read_EXAT_files_from_tape(&biggie_size, biggie_fname,
    23092296                                      &ctrl_chr, xattr_fname, acl_fname);
    23102297    }
     
    23422329        mr_free(tmp);
    23432330
    2344         res = restore_a_biggiefile_from_stream(bkpinfo, biggie_fname,
     2331        res = restore_a_biggiefile_from_stream(biggie_fname,
    23452332                                               current_bigfile_number,
    23462333                                               biggie_cksum,
     
    24282415 */
    24292416int
    2430 restore_all_tarballs_from_stream(struct s_bkpinfo *bkpinfo,
    2431                                  struct s_node *filelist)
     2417restore_all_tarballs_from_stream(struct s_node *filelist)
    24322418{
    24332419    int retval = 0;
     
    24932479            iamhere("Reading EXAT files from tape");
    24942480            res =
    2495                 read_EXAT_files_from_tape(bkpinfo, &tmp_size, tmp_fname,
     2481                read_EXAT_files_from_tape(&tmp_size, tmp_fname,
    24962482                                          &ctrl_chr, xattr_fname,
    24972483                                          acl_fname);
     
    25062492                */
    25072493        res =
    2508             restore_a_tarball_from_stream(bkpinfo, tmp_fname,
     2494            restore_a_tarball_from_stream(tmp_fname,
    25092495                                          current_afioball_number,
    25102496                                          filelist, tmp_size, xattr_fname,
     
    25682554 * @ingroup restoreGroup
    25692555 */
    2570 int restore_everything(struct s_bkpinfo *bkpinfo, struct s_node *filelist)
     2556int restore_everything(struct s_node *filelist)
    25712557{
    25722558    int resA;
     
    26022588    mvaddstr_and_log_it(g_currentY, 0, _("Preparing to read your archives"));
    26032589    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2604         mount_cdrom(bkpinfo);
     2590        mount_cdrom();
    26052591        mvaddstr_and_log_it(g_currentY++, 0,
    26062592                            _("Restoring OS and data from streaming media"));
    26072593        if (bkpinfo->backup_media_type == cdstream) {
    2608             openin_cdstream(bkpinfo);
     2594            openin_cdstream();
    26092595        } else {
    2610             assert_string_is_neither_NULL_nor_zerolength(bkpinfo->
    2611                                                          media_device);
    2612             openin_tape(bkpinfo);
    2613         }
    2614         resA = restore_all_tarballs_from_stream(bkpinfo, filelist);
    2615         resB = restore_all_biggiefiles_from_stream(bkpinfo, filelist);
     2596            assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device);
     2597            openin_tape();
     2598        }
     2599        resA = restore_all_tarballs_from_stream(filelist);
     2600        resB = restore_all_biggiefiles_from_stream(filelist);
    26162601        if (bkpinfo->backup_media_type == cdstream) {
    2617             closein_cdstream(bkpinfo);
     2602            closein_cdstream();
    26182603        } else {
    2619             closein_tape(bkpinfo);
     2604            closein_tape();
    26202605        }
    26212606    } else {
    26222607        mvaddstr_and_log_it(g_currentY++, 0,
    26232608                            _("Restoring OS and data from CD       "));
    2624         mount_cdrom(bkpinfo);
    2625         resA = restore_all_tarballs_from_CD(bkpinfo, filelist);
    2626         resB = restore_all_biggiefiles_from_CD(bkpinfo, filelist);
     2609        mount_cdrom();
     2610        resA = restore_all_tarballs_from_CD(filelist);
     2611        resB = restore_all_biggiefiles_from_CD(filelist);
    26272612    }
    26282613    chdir(cwd);
     
    26512636 */
    26522637int
    2653 restore_live_from_monitas_server(struct s_bkpinfo *bkpinfo,
    2654                                  char *monitas_device,
     2638restore_live_from_monitas_server(char *monitas_device,
    26552639                                 char *restore_this_directory,
    26562640                                 char *restore_here)
     
    27242708
    27252709    unlink(datadisks_fname);
    2726     read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     2710    read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    27272711    retval = load_mountlist(&the_mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo   strcpy(bkpinfo->media_device, monitas_device);
    27282712
     
    27512735    run_program_and_log_output(command, FALSE);
    27522736//  filelist = load_filelist(g_filelist_restthese);  // FIXME --- this probably doesn't work because it doesn't include the biggiefiles
    2753     retval += restore_everything(bkpinfo, filelist);
     2737    retval += restore_everything(filelist);
    27542738    free_filelist(filelist);
    27552739    mr_msg(2, "--------End of restore_live_from_monitas_server--------");
     
    28202804    struct mountlist_itself *mountlist = NULL;
    28212805    struct raidlist_itself *raidlist = NULL;
    2822     struct s_bkpinfo *bkpinfo = NULL;
    28232806    struct s_node *filelist = NULL;
    28242807    char *a = NULL, *b = NULL;
     
    28402823    mr_conf = mr_malloc(sizeof(struct mr_rs_conf));
    28412824    mr_rs_reset_conf(mr_conf);
     2825    bkpinfo = mr_malloc(sizeof(struct s_bkpinfo));
     2826    reset_bkpinfo();
    28422827
    28432828    mr_conf->log_level = DEFAULT_MR_LOGLEVEL;
     
    28592844        g_text_mode = FALSE;
    28602845    }                           // newt :-)
    2861     bkpinfo = mr_malloc(sizeof(struct s_bkpinfo));
    28622846    mountlist = mr_malloc(sizeof(struct mountlist_itself));
    28632847    raidlist = mr_malloc(sizeof(struct raidlist_itself));
     
    28732857    malloc_string(a);
    28742858    malloc_string(b);
    2875     setup_MR_global_filenames(bkpinfo); // malloc() and set globals, using bkpinfo->tmpdir etc.
    2876     reset_bkpinfo(bkpinfo);
     2859    setup_MR_global_filenames();    // malloc() and set globals, using bkpinfo->tmpdir etc.
    28772860    bkpinfo->backup_media_type = none;  // in case boot disk was made for one backup type but user wants to restore from another backup type
    28782861    strcpy(bkpinfo->backup_media_string,"");
     
    29092892
    29102893/* Init directories */
    2911     make_hole_for_dir(bkpinfo->tmpdir);
    2912     mr_asprintf(&tmp, "mkdir -p %s", bkpinfo->tmpdir);
    2913     run_program_and_log_output(tmp, FALSE);
    2914     mr_free(tmp);
    2915 
    29162894    make_hole_for_dir("/var/log");
    29172895    make_hole_for_dir("/tmp/tmpfs");    /* just in case... */
     
    29432921            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
    29442922        }
    2945         res = let_user_edit_the_mountlist(bkpinfo, mountlist, raidlist);
     2923        res = let_user_edit_the_mountlist(mountlist, raidlist);
    29462924#ifdef __FreeBSD__
    29472925        system("mv -f /etc/raidtab /tmp/raidconf.txt");
     
    29772955
    29782956        malloc_string(tmp);
    2979         restore_a_biggiefile_from_CD(bkpinfo, 42, NULL, tmp);
     2957        restore_a_biggiefile_from_CD(42, NULL, tmp);
    29802958        mr_free(tmp);
    29812959    }
     
    30773055        if (argc == 5 && strcmp(argv[1], "--monitas-live") == 0) {
    30783056            retval =
    3079                 restore_live_from_monitas_server(bkpinfo,
    3080                                                  argv[2],
     3057                restore_live_from_monitas_server(argv[2],
    30813058                                                 argv[3], argv[4]);
    30823059        } else {
    30833060            mr_msg(2, "Calling restore_to_live_filesystem()");
    3084             retval = restore_to_live_filesystem(bkpinfo);
     3061            retval = restore_to_live_filesystem();
    30853062        }
    30863063        mr_msg(2, "Still here. Yay.");
     
    31033080        iamhere("About to call load_mountlist and load_raidtab");
    31043081        strcpy(bkpinfo->restore_path, MNT_RESTORING);
    3105         read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     3082        read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    31063083        retval = load_mountlist(mountlist, g_mountlist_fname);
    31073084        retval += load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
     
    31633140        if (argc == 2 && strcmp(argv[1], "--nuke") == 0) {
    31643141            iamhere("nuking");
    3165             retval += nuke_mode(bkpinfo, mountlist, raidlist);
     3142            retval += nuke_mode(mountlist, raidlist);
    31663143        } else if (argc == 2 && strcmp(argv[1], "--interactive") == 0) {
    31673144            iamhere("catchall");
    3168             retval += catchall_mode(bkpinfo, mountlist, raidlist);
     3145            retval += catchall_mode(mountlist, raidlist);
    31693146        } else if (argc == 2 && strcmp(argv[1], "--compare") == 0) {
    31703147            iamhere("compare");
    3171             retval += compare_mode(bkpinfo, mountlist, raidlist);
     3148            retval += compare_mode(mountlist, raidlist);
    31723149        } else if (argc == 2 && strcmp(argv[1], "--iso") == 0) {
    31733150            iamhere("iso");
    3174             retval = iso_mode(bkpinfo, mountlist, raidlist, FALSE);
     3151            retval = iso_mode(mountlist, raidlist, FALSE);
    31753152        } else if (argc == 2 && strcmp(argv[1], "--mbr") == 0) {
    31763153            iamhere("mbr");
     
    31853162        } else if (argc == 2 && strcmp(argv[1], "--isonuke") == 0) {
    31863163            iamhere("isonuke");
    3187             retval = iso_mode(bkpinfo, mountlist, raidlist, TRUE);
     3164            retval = iso_mode(mountlist, raidlist, TRUE);
    31883165        } else if (argc != 1) {
    31893166            log_to_screen(_("Invalid parameters"));
     
    31913168        } else {
    31923169            iamhere("catchall (no mode specified in command-line call");
    3193             retval += catchall_mode(bkpinfo, mountlist, raidlist);
     3170            retval += catchall_mode(mountlist, raidlist);
    31943171        }
    31953172    }
     
    31973174    /* clean up at the end */
    31983175    if (retval) {
    3199         if (does_file_exist("/tmp/changed.files")) {
     3176        if (does_file_exist(MINDI_CACHE"/changed.files")) {
    32003177            log_to_screen
    3201                 (_("See /tmp/changed.files for list of files that have changed."));
     3178                (_("See "MINDI_CACHE"/changed.files for list of files that have changed."));
    32023179        }
    32033180        mvaddstr_and_log_it(g_currentY++,
  • branches/stable/mondo/src/mondorestore/mondorestore.h

    r1346 r1663  
    88 * Compatibility #define to ease the transition to logfile-in-a-variable.
    99 */
    10 char *MONDO_LOGFILE = "/tmp/mondorestore.log";
     10char *MONDO_LOGFILE = "/var/log/mondorestore.log";
    1111
    1212/* Busybox ps has no option and PID in first pos */
  • branches/stable/mondo/src/mondorestore/mr-externs.h

    r1200 r1663  
    1616extern bool ask_me_yes_or_no(char *);
    1717extern char *calc_checksum_of_file(char *);
    18 extern int closein_tape(struct s_bkpinfo *);
     18extern int closein_tape();
    1919extern void close_evalcall_form(void);
    2020extern char *call_program_and_get_last_line_of_output(char *);
     
    5151extern void open_evalcall_form(char *);
    5252extern void open_progress_form(char *, char *, char *, char *, long);
    53 extern int openin_cdstream(struct s_bkpinfo *);
    54 extern int openin_tape(struct s_bkpinfo *);
     53extern int openin_cdstream();
     54extern int openin_tape();
    5555extern int partition_device(char *, int, int, char *, long);
    5656extern int partition_device_with_fdisk(char *, int, int, char *, long);
     
    6161extern bool popup_and_get_string(char *, char *, char *, int);
    6262extern void setup_newt_stuff(void);
    63 extern void reset_bkpinfo(struct s_bkpinfo *);
     63extern void reset_bkpinfo();
    6464extern int read_cfg_var(char *, char *, char *);
    65 extern int read_file_from_stream_to_file(struct s_bkpinfo *, char *,
     65extern int read_file_from_stream_to_file(char *,
    6666                                         long long);
    67 extern int read_file_from_stream_to_stream(struct s_bkpinfo *, FILE *,
     67extern int read_file_from_stream_to_stream(FILE *,
    6868                                           long long);
    69 extern int read_file_from_stream_FULL(struct s_bkpinfo *, char *, FILE *,
     69extern int read_file_from_stream_FULL(char *, FILE *,
    7070                                      long long);
    7171extern int read_header_block_from_stream(long long *, char *, int *);
     
    7878extern void update_evalcall_form(int);
    7979extern void update_progress_form(char *);
    80 extern int verify_tape_backups(struct s_bkpinfo *);
     80extern int verify_tape_backups();
    8181extern char which_restore_mode(void);
    8282extern int which_format_command_do_i_need(char *, char *);
     
    9191                                                                mountlist_itself
    9292                                                                *mountlist);
    93 extern int get_cfg_file_from_archive(struct s_bkpinfo *);
     93extern int get_cfg_file_from_archive();
    9494
    9595
  • branches/stable/pbconf/mindi/pbfilter/rpm.pbf

    r1633 r1663  
    3131filter PBPKG = $pbpkg
    3232
    33 # PBSUF is replaced by the package name ($pbsuf in code)
     33# PBSUF is replaced by the suffix name ($pbsuf in code)
    3434filter PBSUF = $pbsuf
    3535
  • branches/stable/pbconf/mondo/pbfilter/rpm.pbf

    r1633 r1663  
    3131filter PBPKG = $pbpkg
    3232
    33 # PBSUF is replaced by the package name ($pbsuf in code)
     33# PBSUF is replaced by the suffix name ($pbsuf in code)
    3434filter PBSUF = $pbsuf
    3535
  • branches/stable/pbconf/mondo/rpm/mondo.spec

    r1633 r1663  
    33#
    44
    5 Summary:    A program which a Linux user can utilize to create a rescue/restore CD/tape
    6 Summary(fr):    Un programme pour les utilisateurs de Linux pour créer un CD/tape de sauvegarde/restauration
     5Summary:    A program to create a rescue/restore CD/tape
     6Summary(fr):    Un programme pour créer un media de sauvegarde/restauration
    77Summary(it):    Un programma per utenti Linux per creare un CD/tape di rescue
    8 Summary(sp):    Un programa para los usuarios de Linux por crear una CD/cinta de restoracion/rescate
     8Summary(sp):    Un programa por crear una CD/cinta de restoracion/rescate
    99
    1010Name:       PBPKG
  • branches/stable/pbconf/mondorescue.pb

    r1619 r1663  
    1313defpkgdir mindi = mindi
    1414
    15 pkgver nil
    16 pkgtag nil
     15pkgver mindi = 1.2.5
     16pkgver mindi-busybox = 1.2.2
     17pkgtag mindi-busybox = 4
    1718
    1819# Hash of additional package/package directory
     
    2627# List of additional files on which to apply filters
    2728# Files are mentioned relatively to pbroot
     29filteredfiles mondo = configure.in
    2830filteredfiles mondo-doc = mondorescue-howto.sgml,mondoarchive.8,mondorestore.8
    2931filteredfiles mindi = rootfs/sbin/init,mindi,install.sh
  • branches/stable/tools/qemu-vm.txt

    r1633 r1663  
    1515# gentoo
    1616#Cf: http://wiki.xensource.com/xenwiki/QEMUGentoo
    17 emerge neon newt slang autoconf automake subversion libtool gcc wget vim man groff lynx grub afio buffer mindi mondo-rescue sudo jadetex docbook2ps pb # cdrecord mkisofs
     17emerge neon newt slang autoconf automake subversion libtool gcc wget vim man groff lynx grub afio buffer mindi mondo-rescue cdrecord mkisofs pb
    1818
    1919# Slackware
Note: See TracChangeset for help on using the changeset viewer.