Changeset 1939 in MondoRescue for branches/stable/mondo/src/common
- Timestamp:
- May 17, 2008, 1:29:54 AM (17 years ago)
- Location:
- branches/stable/mondo/src/common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/Makefile.am
r1924 r1939 4 4 ## Process this file with Automake to generate `Makefile.in' 5 5 ## 6 AM_CPPFLAGS = -DMONDO_SHARE=\"$(pkgdatadir)\" -DMONDO_CONF_DIR=\"$(sysconfdir) \" -I${top_builddir}/src/include6 AM_CPPFLAGS = -DMONDO_SHARE=\"$(pkgdatadir)\" -DMONDO_CONF_DIR=\"$(sysconfdir)/mondo\" -I${top_builddir}/src/include -I${top_builddir}/src/common 7 7 8 8 ## libmondo -
branches/stable/mondo/src/common/libmondo-archive.c
r1904 r1939 951 951 mr_free(command); 952 952 } else { 953 mr_asprintf(&command, "cp -f %s/mindi-*oot*.img %s/images",954 bkpinfo->tmpdir, bkpinfo->scratchdir);955 if (system(command)) {956 mr_msg(2, "Unable to copy mindi images");957 }958 mr_free(command);959 960 953 mr_asprintf(&tmp, "cp -f %s/images/all.tar.gz %s", 961 954 bkpinfo->scratchdir, bkpinfo->tmpdir); … … 1368 1361 int i; 1369 1362 char *curr_xattr_list_fname = NULL; 1370 char *curr_acl_list_fname ;1363 char *curr_acl_list_fname = NULL; 1371 1364 int misc_counter_that_is_not_important = 0; 1372 1365 … … 1476 1469 res += write_EXAT_files_to_tape(curr_xattr_list_fname, 1477 1470 curr_acl_list_fname); 1471 // archives themselves 1472 res += 1473 write_EXAT_files_to_tape(curr_xattr_list_fname, 1474 curr_acl_list_fname); 1478 1475 // archives themselves 1479 1476 res += … … 2152 2149 curr_afioball_fname); 2153 2150 iamhere("Writing EXAT files"); 2154 res += write_EXAT_files_to_tape(curr_xattr_list_fname, 2155 curr_acl_list_fname); 2151 res += 2152 write_EXAT_files_to_tape(curr_xattr_list_fname, 2153 curr_acl_list_fname); 2156 2154 // archives themselves 2157 2155 res = move_files_to_stream(curr_afioball_fname, NULL); -
branches/stable/mondo/src/common/libmondo-cli.c
r1924 r1939 170 170 extern bool g_text_mode; 171 171 extern char g_startdir[MAX_STR_LEN]; ///< ????? @bug ????? 172 extern bool g_sigpipe;173 172 extern char *MONDO_OPTIONS; 174 173 -
branches/stable/mondo/src/common/libmondo-devices.c
r1924 r1939 1567 1567 bkpinfo->nonbootable_backup = FALSE; 1568 1568 1569 // Tape, CD, NFS, ...?1569 // Tape, CD, NFS, ...? 1570 1570 srandom(getpid()); 1571 1571 bkpinfo->backup_media_type = … … 1576 1576 finish(1); 1577 1577 } 1578 /* Why asking to remove the media with tape ? 1578 1579 if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) { 1579 1580 popup_and_OK(_("Please remove media from drive")); 1580 1581 } 1582 */ 1581 1583 mr_msg(3, "media type = %s", 1582 1584 bkptype_to_string(bkpinfo->backup_media_type)); … … 1588 1590 mvaddstr_and_log_it(2, 0, " "); 1589 1591 1590 // Find device's /dev (or SCSI) entry1592 // Find device's /dev (or SCSI) entry 1591 1593 switch (bkpinfo->backup_media_type) { 1592 1594 case cdr: -
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.