Ignore:
Timestamp:
May 17, 2008, 1:29:54 AM (12 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 1923:1938 $SVN_M/branches/2.2.6

File:
1 edited

Legend:

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

    r1924 r1939  
    3030
    3131#define EXTRA_TAPE_CHECKSUMS
     32#define STR_HEADER  "Mondolicious, baby"
    3233
    3334/*@unused@*/
     
    362363{
    363364    int res = 0;
    364     int retval = 0;
    365365    char *fname = (char *)&res;                 /* Should NOT be NULL */
    366366
    367 // xattr
     367    // xattr
    368368    if (g_getfattr) {
    369369        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
     
    372372        }
    373373        if (!strstr(fname, "xattr")) {
    374             fatal_error("Wrong order, sunshine.");
     374            fatal_error("Wrong order for xattr, sunshine.");
    375375        }
    376376        read_file_from_stream_to_file(xattr_fname, *ptmp_size);
     
    380380        }
    381381        mr_msg(1, "Got xattr");
     382        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     383        if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) {
     384            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
     385        }
     386        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     387        if (pctrl_chr == BLK_START_AN_AFIO_OR_SLICE) {
     388            log_msg(1, "No acl attributes found, skipping to afio files");
     389            return(0);
     390        } else {
     391            if (pctrl_chr != BLK_START_EXTENDED_ATTRIBUTES) {
     392                wrong_marker(BLK_START_EXTENDED_ATTRIBUTES, *pctrl_chr);
     393            }
     394        }
    382395    }
    383396    // acl
     
    385398        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    386399        if (!strstr(fname, "acl")) {
    387             fatal_error("Wrong order, sunshine.");
     400            fatal_error("Wrong order for acl, sunshine.");
    388401        }
    389402        if (*pctrl_chr != BLK_START_EXAT_FILE) {
     
    403416    // tarball itself
    404417    res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    405     mr_msg(1, "now looking for afioball");
    406     return (retval);
     418    mr_msg(1, "End of extended attributes, now looking for afioball");
     419    return (0);
    407420}
    408421
     
    420433        write_file_to_stream_from_file(xattr_fname);
    421434        write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
     435        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     436                             BLK_STOP_EXTENDED_ATTRIBUTES);
    422437    }
    423438    if (g_getfacl) {
    424439    // acl
     440        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
     441                             BLK_START_EXTENDED_ATTRIBUTES);
    425442        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    426443                             BLK_START_EXAT_FILE);
    427444        write_file_to_stream_from_file(acl_fname);
    428445        write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    429         write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     446        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    430447                             BLK_STOP_EXTENDED_ATTRIBUTES);
    431448    }
     
    10081025    }
    10091026    memcpy((char *) plen, tempblock + 7001, sizeof(long long));
    1010     if (strcmp(tempblock + 6000 + *pcontrol_char, "Mondolicious, baby")) {
     1027    if (strcmp(tempblock + 6000 + *pcontrol_char, STR_HEADER)) {
    10111028        log_it("Bad header block at %ld K", (long) g_tape_posK);
    10121029    }
     
    15941611        tempblock[i] = 0;
    15951612    }
    1596     sprintf(tempblock + 6000 + control_char, "Mondolicious, baby");
     1613    sprintf(tempblock + 6000 + control_char, STR_HEADER);
    15971614    tempblock[7000] = control_char;
    15981615    memcpy(tempblock + 7001, (char *) &olen, sizeof(off_t));
Note: See TracChangeset for help on using the changeset viewer.