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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-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        }
Note: See TracChangeset for help on using the changeset viewer.