Changeset 1185 in MondoRescue for trunk/mondo/src/common/libmondo-verify.c
- Timestamp:
- Feb 19, 2007, 1:51:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/src/common/libmondo-verify.c
r1086 r1185 9 9 #include "my-stuff.h" 10 10 #include "mr_mem.h" 11 #include "mr_msg.h" 12 11 13 #include "mondostructures.h" 12 14 #include "libmondo-verify.h" … … 18 20 #include "libmondo-devices-EXT.h" 19 21 #include "libmondo-tools-EXT.h" 20 #include "mr_mem.h"21 22 22 23 /*@unused@*/ … … 50 51 { 51 52 /*@ buffer ********************************************************** */ 52 char *command ;53 char *afio_found_changes ;53 char *command = NULL; 54 char *afio_found_changes = NULL; 54 55 55 56 /*@ int ************************************************************* */ … … 66 67 sync(); 67 68 68 /* s-printf (command,69 "grep \"afio: \" %s | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort -u | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s",70 stderr_fname, afio_found_changes);71 */72 69 73 70 mr_msg(1, "Now scanning log file for 'afio: ' stuff"); … … 183 180 } 184 181 185 186 182 /** 187 183 * Verify all slices stored on the inserted CD (or a mounted ISO image). … … 197 193 { 198 194 195 /*@ buffer ********************************************************** */ 199 196 char *tmp = NULL; 200 197 char *tmp1 = NULL; … … 235 232 mr_asprintf(&sz_exe, "lzop"); 236 233 } else if (bkpinfo->use_gzip) { 237 strcpy(sz_exe, "gzip"); 238 } else if (bkpinfo->use_gzip) { 239 strcpy(sz_exe, "gzip"); 234 mr_asprintf(&sz_exe, "gzip"); 240 235 } else { 241 236 mr_asprintf(&sz_exe, "bzip2"); 242 237 } 243 238 } else { 244 mr_asprintf(&sz_exe, " 239 mr_asprintf(&sz_exe, ""); 245 240 } 246 241 … … 381 376 { 382 377 /*@ buffers ********************************************************* */ 383 char *command ;384 char *outlog ;378 char *command = NULL; 379 char *outlog = NULL; 385 380 char *tmp = NULL; 386 // char *p;387 381 388 382 /*@ pointers ******************************************************* */ 389 FILE *pin ;383 FILE *pin = NULL; 390 384 391 385 size_t n = 0; … … 399 393 log_it("Verifying fileset '%s'", tarball_fname); 400 394 401 /* chdir("/"); */402 395 mr_asprintf(&outlog, "%s/afio.log", bkpinfo->tmpdir); 403 396 … … 430 423 if (strstr(tarball_fname, ".star")) { 431 424 bkpinfo->use_star = TRUE; 432 if (strstr(tarball_fname, ".bz2")) 425 if (strstr(tarball_fname, ".bz2")) { 433 426 mr_asprintf(&command, 434 427 "star -diff diffopts=mode,size,data file=%s %s >> %s 2>> %s", … … 436 429 (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog, 437 430 outlog); 431 } else { 432 mr_asprintf(&command,""); 433 } 438 434 } else { 439 435 bkpinfo->use_star = FALSE; … … 446 442 447 443 if (length_of_file(outlog) < 10) { 444 /* BERLIOS: This seems useless !! */ 448 445 mr_asprintf(&command, "cat %s >> %s", outlog, MONDO_LOGFILE); 449 446 } else { … … 488 485 mr_free(command); 489 486 490 /* chdir(old_pwd); */491 // s-printf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);492 // paranoid_system (tmp);493 // unlink ("/tmp/mondo-verify.err");494 487 return (0); 495 488 } … … 543 536 544 537 /*@ buffers ********************************************************** */ 545 char *tmp ;546 char *tarball_fname ;538 char *tmp = NULL; 539 char *tarball_fname = NULL; 547 540 548 541 /*@ pointers ********************************************************* */ 549 char *p ;542 char *p = NULL; 550 543 551 544 assert(bkpinfo != NULL); … … 563 556 564 557 mr_asprintf(&tarball_fname, "%s/tmpfs/temporary-%s", bkpinfo->tmpdir, p); 565 /* BERLIOS : useless566 mr_asprintf(&tmp, "Temporarily copying file from tape to '%s'",567 tarball_fname);568 log_it(tmp);569 mr_free(tmp);570 */571 558 read_file_from_stream_to_file(bkpinfo, tarball_fname, size); 572 559 res = verify_a_tarball(bkpinfo, tarball_fname); 573 560 if (res) { 574 mr_asprintf(&tmp, 575 "Afioball '%s' no longer matches your live filesystem", 576 p); 577 mr_msg(0, tmp); 578 mr_free(tmp); 561 mr_msg(0, "Afioball '%s' no longer matches your live filesystem", p); 579 562 retval++; 580 563 } … … 604 587 605 588 /*@ char ************************************************************ */ 606 char *test_file ;607 char *biggie_cksum ;608 char *orig_cksum ;609 char *tmp ;589 char *test_file = NULL; 590 char *biggie_cksum = NULL; 591 char *orig_cksum = NULL; 592 char *tmp = NULL; 610 593 char *slice_fnam = (char *) &res; 611 594 … … 626 609 } 627 610 mr_asprintf(&test_file, "%s/temporary-%s", bkpinfo->tmpdir, p); 628 mr_asprintf(&tmp,629 "Temporarily copying biggiefile %s's slices from tape to '%s'",630 p, test_file);631 log_it(tmp);632 mr_free(tmp);633 611 for (res = 634 612 read_header_block_from_stream(&slice_siz, slice_fnam, &ctrl_chr); … … 704 682 705 683 /*@ buffers ***************************************************** */ 706 char *tmp ;684 char *tmp = NULL; 707 685 char *fname = (char *) &res; /* Should NOT be NULL */ 708 char *curr_xattr_list_fname ;709 char *curr_acl_list_fname ;686 char *curr_xattr_list_fname = NULL; 687 char *curr_acl_list_fname = NULL; 710 688 711 689 /*@ long long *************************************************** */ … … 772 750 } 773 751 mr_asprintf(&tmp, "Verifying fileset #%ld", current_afioball_number); 774 /*log_it(tmp); */775 752 update_progress_form(tmp); 776 753 mr_free(tmp); … … 824 801 /*@ buffers ******************************************************** */ 825 802 char *orig_fname = (char *) &ctrl_chr; /* Should NOT be NULL */ 826 char *logical_fname ;827 char *comment ;828 char *curr_xattr_list_fname ;829 char *curr_acl_list_fname ;803 char *logical_fname = NULL; 804 char *comment = NULL; 805 char *curr_xattr_list_fname = NULL; 806 char *curr_acl_list_fname = NULL; 830 807 /*@ pointers ******************************************************* */ 831 char *p ;808 char *p = NULL; 832 809 833 810 /*@ long long size ************************************************* */ … … 931 908 932 909 /*@ buffers ******************************************************** */ 933 char *mountpoint ;934 char *command ;935 char *tmp ;936 char *fname ;910 char *mountpoint = NULL; 911 char *command = NULL; 912 char *tmp = NULL; 913 char *fname = NULL; 937 914 #ifdef __FreeBSD__ 938 915 char mdd[32]; … … 991 968 log_to_screen(tmp); 992 969 mr_free(tmp); 970 mr_free(command); 993 971 return (1); 994 972 } … … 1014 992 verify_all_slices_on_CD(bkpinfo, mountpoint); 1015 993 994 mr_asprintf(&command, "umount %s", mountpoint); 1016 995 #ifdef __FreeBSD__ 1017 996 ret = 0; 1018 mr_asprintf(&command, "umount %s", mountpoint);1019 997 ret += system(command); 1020 1021 998 ret += kick_vn(mddevice); 1022 999 if (ret) 1023 1000 #else 1024 mr_asprintf(&command, "umount %s", mountpoint);1025 1026 1001 if (system(command)) 1027 1002 #endif … … 1067 1042 1068 1043 /*@ buffers ******************************************************** */ 1069 char *tmp ;1070 char *changed_files_fname ;1044 char *tmp = NULL; 1045 char *changed_files_fname = NULL; 1071 1046 1072 1047 /*@ long *********************************************************** */ … … 1089 1064 1090 1065 /* close tape; exit */ 1091 // fclose(g_tape_stream); <-- not needed; is handled by closein_tape()1092 1066 paranoid_system 1093 1067 ("rm -f /tmp/biggies.changed /tmp/changed.files.[0-9]* 2> /dev/null");
Note:
See TracChangeset
for help on using the changeset viewer.