Changeset 1939 in MondoRescue for branches/stable/mondo/src/common/libmondo-stream.c
- Timestamp:
- May 17, 2008, 1:29:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-stream.c
r1924 r1939 30 30 31 31 #define EXTRA_TAPE_CHECKSUMS 32 #define STR_HEADER "Mondolicious, baby" 32 33 33 34 /*@unused@*/ … … 362 363 { 363 364 int res = 0; 364 int retval = 0;365 365 char *fname = (char *)&res; /* Should NOT be NULL */ 366 366 367 // xattr367 // xattr 368 368 if (g_getfattr) { 369 369 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); … … 372 372 } 373 373 if (!strstr(fname, "xattr")) { 374 fatal_error("Wrong order , sunshine.");374 fatal_error("Wrong order for xattr, sunshine."); 375 375 } 376 376 read_file_from_stream_to_file(xattr_fname, *ptmp_size); … … 380 380 } 381 381 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 } 382 395 } 383 396 // acl … … 385 398 res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr); 386 399 if (!strstr(fname, "acl")) { 387 fatal_error("Wrong order , sunshine.");400 fatal_error("Wrong order for acl, sunshine."); 388 401 } 389 402 if (*pctrl_chr != BLK_START_EXAT_FILE) { … … 403 416 // tarball itself 404 417 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); 407 420 } 408 421 … … 420 433 write_file_to_stream_from_file(xattr_fname); 421 434 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); 422 437 } 423 438 if (g_getfacl) { 424 439 // acl 440 write_header_block_to_stream(length_of_file(acl_fname), acl_fname, 441 BLK_START_EXTENDED_ATTRIBUTES); 425 442 write_header_block_to_stream(length_of_file(acl_fname), acl_fname, 426 443 BLK_START_EXAT_FILE); 427 444 write_file_to_stream_from_file(acl_fname); 428 445 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, 430 447 BLK_STOP_EXTENDED_ATTRIBUTES); 431 448 } … … 1008 1025 } 1009 1026 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)) { 1011 1028 log_it("Bad header block at %ld K", (long) g_tape_posK); 1012 1029 } … … 1594 1611 tempblock[i] = 0; 1595 1612 } 1596 sprintf(tempblock + 6000 + control_char, "Mondolicious, baby");1613 sprintf(tempblock + 6000 + control_char, STR_HEADER); 1597 1614 tempblock[7000] = control_char; 1598 1615 memcpy(tempblock + 7001, (char *) &olen, sizeof(off_t));
Note:
See TracChangeset
for help on using the changeset viewer.