Changeset 2318 in MondoRescue
- Timestamp:
- Aug 18, 2009, 2:36:47 PM (15 years ago)
- Location:
- branches/2.2.10/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2317 r2318 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" … … 542 543 543 544 assert(bkpinfo != NULL); 544 mr_asprintf(&tmp, "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'", 545 bkpinfo->exclude_paths); 545 mr_asprintf(&tmp, "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'", bkpinfo->exclude_paths); 546 546 mr_asprintf(&devs_to_exclude, "%s", call_program_and_get_last_line_of_output(tmp)); 547 547 mr_free(tmp); -
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2316 r2318 806 806 log_to_screen("Not archiving the following file systems:\n"); 807 807 log_to_screen(" %s\n", not_mounted_on_dsf); 808 strcat(bkpinfo->exclude_paths, not_mounted_on_dsf); 809 strcat(bkpinfo->exclude_paths, ""); 808 mr_strcat(bkpinfo->exclude_paths, "%s ", not_mounted_on_dsf); 810 809 } 811 810 break; … … 1095 1094 log_to_screen("Please supply a sensible value with '-E'\n"); 1096 1095 } 1097 if (bkpinfo->exclude_paths[0]) { 1098 strcat(bkpinfo->exclude_paths, " "); 1099 } 1096 mr_strcat(bkpinfo->exclude_paths, " "); 1100 1097 mr_asprintf(&tmp1, "%s", flag_val['E']); 1101 1098 … … 1140 1137 log_to_screen(" %s\n", mounted_on_dsf); 1141 1138 log_msg (5, "Adding to bkpinfo->exclude_paths due to -E option: %s", mounted_on_dsf); 1142 strcat(bkpinfo->exclude_paths, mounted_on_dsf);1143 strcat(bkpinfo->exclude_paths, " ");1139 mr_strcat(bkpinfo->exclude_paths, "%s ", mounted_on_dsf); 1140 } 1144 1141 } 1145 1142 break; … … 1150 1147 /* A device special file was not passed in. Process it as a path. */ 1151 1148 case -1: 1152 strcat(bkpinfo->exclude_paths, token); 1153 strcat(bkpinfo->exclude_paths, " "); 1149 mr_strcat(bkpinfo->exclude_paths, "%s ", token); 1154 1150 break; 1155 1151 } 1156 1152 mr_free(token); 1157 1153 } 1158 log_msg(1, "exclude_paths is now '%s'", bkpinfo->exclude_paths); 1154 if (bkpinfo->exclude_paths != NULL) { 1155 log_msg(1, "exclude_paths is now '%s'", bkpinfo->exclude_paths); 1156 } 1159 1157 log_msg(4, "Finished with the -E option"); 1160 1158 } … … 1166 1164 if ((flag_set['N']) && (! bkpinfo->restore_data)) // exclude NFS mounts & devices 1167 1165 { 1168 // strncpy(psz, list_of_NFS_devices_and_mounts(), MAX_STR_LEN);1169 1166 mr_asprintf(&psz, "%s", list_of_NFS_mounts_only()); 1170 if (bkpinfo->exclude_paths[0]) { 1171 strncat(bkpinfo->exclude_paths, " ", 4*MAX_STR_LEN); 1172 } 1173 strncat(bkpinfo->exclude_paths, psz, 4*MAX_STR_LEN); 1167 mr_strcat(bkpinfo->exclude_paths, "%s ", psz); 1174 1168 mr_free(psz); 1175 1169 1176 log_msg(3, "-N means we're now excluding %s", 1177 bkpinfo->exclude_paths); 1178 } 1179 1180 if (strlen(bkpinfo->exclude_paths) >= 4*MAX_STR_LEN) { 1181 fatal_error 1182 ("Your '-E' parameter is too long. Increase MAX_STR_LEN"); 1170 if (bkpinfo->exclude_paths != NULL) { 1171 log_msg(3, "-N means we're now excluding %s", bkpinfo->exclude_paths); 1172 } 1183 1173 } 1184 1174 -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2316 r2318 1938 1938 mr_asprintf(&tmp, "%s", list_of_NFS_mounts_only()); 1939 1939 if (strlen(tmp) > 2) { 1940 if (bkpinfo->exclude_paths[0]) { 1941 strcat(bkpinfo->exclude_paths, " "); 1942 } 1943 strncpy(bkpinfo->exclude_paths, tmp, MAX_STR_LEN); 1940 mr_strcat(bkpinfo->exclude_paths, " %s",tmp); 1944 1941 } 1945 1942 mr_free(tmp); … … 1963 1960 finish(1); 1964 1961 } 1965 strcpy(bkpinfo->exclude_paths, p);1966 mr_free(p);1962 mr_free(bkpinfo->exclude_paths); 1963 bkpinfo->exclude_paths = p; 1967 1964 1968 1965 p = popup_and_get_string("Temporary directory", "Please enter your temporary directory.", bkpinfo->tmpdir); -
branches/2.2.10/mondo/src/common/libmondo-string.c
r2316 r2318 54 54 } else { 55 55 if (isdigit(partition[-1])) { 56 mr_strcat(partition, 56 mr_strcat(partition, "%c", 57 57 #ifdef BSD 58 58 's'); … … 506 506 507 507 q = ip; 508 while ((p = strstr(q, token) != NULL)) {508 while ((p = strstr(q, token)) != NULL) { 509 509 *p = '\0'; 510 510 if (output) { -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2317 r2318 814 814 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 815 815 bkpinfo->include_paths[0] = '\0'; 816 bkpinfo->exclude_paths[0] = '\0';817 816 bkpinfo->restore_path[0] = '\0'; 818 817 bkpinfo->call_before_iso[0] = '\0'; … … 823 822 bkpinfo->nfs_mount[0] = '\0'; 824 823 bkpinfo->nfs_user = NULL; 824 bkpinfo->exclude_paths = NULL; 825 825 bkpinfo->nfs_remote_dir[0] = '\0'; 826 826 bkpinfo->postnuke_tarball[0] = '\0'; -
branches/2.2.10/mondo/src/common/newt-specific.c
r2316 r2318 427 427 mr_asprintf(&command, "rm -Rf %s", bkpinfo->tmpdir); 428 428 system(command); 429 paranoid_free(command);429 mr_free(command); 430 430 } 431 431 } … … 436 436 mr_asprintf(&command, "rm -Rf %s", bkpinfo->scratchdir); 437 437 system(command); 438 paranoid_free(command);438 mr_free(command); 439 439 } 440 440 } 441 441 /* Free all allocated strings in bkpinfo */ 442 442 mr_free(bkpinfo->nfs_user); 443 mr_free(bkpinfo->exclude_paths); 443 444 444 445 /* Then free the structure */
Note:
See TracChangeset
for help on using the changeset viewer.