Changeset 2697 in MondoRescue
- Timestamp:
- Jan 25, 2011, 10:44:33 AM (14 years ago)
- Location:
- branches/2.2.9/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-archive.c
r2627 r2697 13 13 #include "my-stuff.h" 14 14 #include "mr_mem.h" 15 #include "mr_str.h" 15 16 #include "mondostructures.h" 16 17 #include "libmondo-string-EXT.h" -
branches/2.2.9/mondo/src/common/libmondo-cli.c
r2694 r2697 612 612 log_to_screen("Please supply a sensible value with '-E'\n"); 613 613 } 614 if (bkpinfo->exclude_paths[0]) { 615 strcat(bkpinfo->exclude_paths, " "); 616 } 614 mr_strcat(bkpinfo->exclude_paths, " "); 617 615 mr_asprintf(&tmp1, "%s", flag_val['E']); 618 616 … … 658 656 { 659 657 mr_asprintf(&psz, "%s", list_of_NETFS_mounts_only()); 660 if (bkpinfo->exclude_paths[0]) { 661 strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN); 662 } 663 strncat(bkpinfo->exclude_paths, psz, 4*MAX_STR_LEN); 658 mr_strcat(bkpinfo->exclude_paths, "%s ", psz); 664 659 mr_free(psz); 665 660 666 log_msg(3, "-N means we're now excluding %s", 667 bkpinfo->exclude_paths); 668 } 669 670 if (strlen(bkpinfo->exclude_paths) >= 4*MAX_STR_LEN) { 671 fatal_error 672 ("Your '-E' parameter is too long. Increase MAX_STR_LEN"); 661 if (bkpinfo->exclude_paths != NULL) { 662 log_msg(3, "-N means we're now excluding %s", bkpinfo->exclude_paths); 663 } 673 664 } 674 665 -
branches/2.2.9/mondo/src/common/libmondo-devices.c
r2683 r2697 2064 2064 log_to_screen("==> %s", mounted_on_dsf); 2065 2065 log_msg (5, "Adding to bkpinfo->exclude_paths due to -E option: %s", mounted_on_dsf); 2066 strcat(bkpinfo->exclude_paths, " "); 2067 strcat(bkpinfo->exclude_paths, mounted_on_dsf); 2068 strcat(bkpinfo->exclude_paths, " "); 2066 mr_strcat(bkpinfo->exclude_paths, " %s ",mounted_on_dsf); 2069 2067 mr_strcat(bkpinfo->exclude_devs, " %s ",token); 2070 2068 } … … 2077 2075 log_to_screen("Not archiving the following file systems:"); 2078 2076 log_to_screen("==> %s", not_mounted_on_dsf); 2079 strcat(bkpinfo->exclude_paths, " "); 2080 strcat(bkpinfo->exclude_paths, not_mounted_on_dsf); 2081 strcat(bkpinfo->exclude_paths, " "); 2077 mr_strcat(bkpinfo->exclude_paths, " %s ", not_mounted_on_dsf); 2082 2078 } 2083 2079 } … … 2095 2091 mr_asprintf(&tmp," %s ",bkpinfo->exclude_paths); 2096 2092 if (strstr(tmp,tmp1) == NULL) { 2097 strcat(bkpinfo->exclude_paths, tmp1);2093 mr_strcat(bkpinfo->exclude_paths, tmp1); 2098 2094 } 2099 2095 } else { … … 2141 2137 char *tmp1 = NULL; 2142 2138 char *mds = NULL; 2139 char p[8*MAX_STR_LEN]; 2143 2140 char *sz_size; 2144 2141 char *command; … … 2658 2655 mr_asprintf(&tmp, "%s", list_of_NETFS_mounts_only()); 2659 2656 if (strlen(tmp) > 2) { 2660 if (bkpinfo->exclude_paths[0]) { 2661 strcat(bkpinfo->exclude_paths, " "); 2662 } 2663 strncpy(bkpinfo->exclude_paths, tmp, MAX_STR_LEN); 2657 mr_strcat(bkpinfo->exclude_paths, " %s",tmp); 2664 2658 } 2665 2659 mr_free(tmp); … … 2677 2671 } 2678 2672 2679 2680 if (!popup_and_get_string 2681 ("Exclude paths", 2682 "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", 2683 bkpinfo->exclude_paths, (4*MAX_STR_LEN)-1)) { 2673 strncpy(p,bkpinfo->exclude_paths,(8*MAX_STR_LEN)-1); 2674 popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", p, (8*MAX_STR_LEN)-1); 2675 if (p == NULL) { 2684 2676 log_to_screen("User has chosen not to backup the PC"); 2685 2677 finish(1); 2686 2678 } 2687 /* Always needs to be finished by a space */2688 if (bkpinfo->exclude_paths[0]) {2689 strcat(bkpinfo->exclude_paths, " ");2690 } 2679 mr_free(bkpinfo->exclude_paths); 2680 mr_asprintf(&tmp, "%s", p); 2681 bkpinfo->exclude_paths = tmp; 2682 2691 2683 if (!popup_and_get_string 2692 2684 ("Temporary directory", -
branches/2.2.9/mondo/src/common/libmondo-tools.c
r2686 r2697 787 787 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 788 788 bkpinfo->include_paths[0] = '\0'; 789 bkpinfo->exclude_paths[0] = '\0';790 789 bkpinfo->exclude_devs = NULL; 791 790 bkpinfo->restore_path[0] = '\0'; … … 799 798 bkpinfo->netfs_user = NULL; 800 799 bkpinfo->netfs_remote_dir[0] = '\0'; 800 bkpinfo->exclude_paths = NULL; 801 801 bkpinfo->postnuke_tarball[0] = '\0'; 802 802 bkpinfo->wipe_media_first = FALSE; -
branches/2.2.9/mondo/src/common/mondostructures.h
r2424 r2697 522 522 * the scratchdir, and the tempdir are automatically excluded. 523 523 */ 524 char exclude_paths[MAX_STR_LEN*4];524 char *exclude_paths; 525 525 526 526 /** -
branches/2.2.9/mondo/src/common/newt-specific.c
r2424 r2697 432 432 mr_asprintf(&command, "rm -Rf %s", bkpinfo->tmpdir); 433 433 system(command); 434 paranoid_free(command);434 mr_free(command); 435 435 } 436 436 } … … 441 441 mr_asprintf(&command, "rm -Rf %s", bkpinfo->scratchdir); 442 442 system(command); 443 paranoid_free(command);443 mr_free(command); 444 444 } 445 445 } … … 448 448 mr_free(bkpinfo->netfs_proto); 449 449 mr_free(bkpinfo->exclude_devs); 450 mr_free(bkpinfo->exclude_paths); 450 451 451 452 /* Then free the structure */
Note:
See TracChangeset
for help on using the changeset viewer.