Changeset 3856 in MondoRescue for branches/3.3/mondo/src/common
- Timestamp:
- Mar 6, 2024, 5:29:44 PM (18 months ago)
- Location:
- branches/3.3/mondo/src/common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-archive.c
r3849 r3856 67 67 extern bool g_cd_recovery; 68 68 extern char *g_mondo_home; 69 70 /**71 * The serial string (used to differentiate between backups) of the current backup.72 */73 char *g_serial_string = NULL;74 69 75 70 extern char *g_getfacl; … … 1124 1119 * - @c scratchdir 1125 1120 * - @c tmpdir 1121 * - @c serial_string 1126 1122 * @return The number of errors encountered (0 for success). 1127 1123 * @ingroup MLarchiveGroup … … 1140 1136 mr_asprintf(data_disks_file, "%s/all.tar.gz", bkpinfo->tmpdir); 1141 1137 1142 tmp = call_program_and_get_last_line_of_output("dd if=/dev/urandom bs=16 count=1 2> /dev/null | hexdump | tr -s ' ' '0' | head -n1"); 1143 snprintf(g_serial_string, MAX_STR_LEN - 8, "%s", tmp); 1144 mr_free(tmp); 1145 strip_spaces(g_serial_string); 1146 strcat(g_serial_string, "...word."); 1147 log_msg(2, "g_serial_string = '%s'", g_serial_string); 1148 assert(strlen(g_serial_string) < MAX_STR_LEN); 1138 tmp = call_program_and_get_last_line_of_output("dd if=/dev/urandom bs=16 count=1 2> /dev/null | hexdump | tr -s ' ' '0' | head -n1"); 1139 bkpinfo->serial_string = mr_strip_spaces(tmp); 1140 mr_free(tmp); 1141 mr_strcat(bkpinfo->serial_string, "...word."); 1142 log_msg(2, "bkpinfo->serial_string = '%s'", bkpinfo->serial_string); 1149 1143 1150 1144 mr_asprintf(tmpfile, "%s/archives/SERIAL-STRING", bkpinfo->scratchdir); 1151 if (write_one_liner_data_file(tmpfile, g_serial_string)) {1145 if (write_one_liner_data_file(tmpfile, bkpinfo->serial_string)) { 1152 1146 log_msg(1, "%ld: Failed to write serial string", __LINE__); 1153 1147 } … … 2584 2578 2585 2579 log_msg(2, "paafcd: cd_number = %d", cd_number); 2586 log_msg(2, "our serial str = %s; g_serial_string = %s", our_serial_str, g_serial_string);2587 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) {2580 log_msg(2, "our serial str = %s; bkpinfo->serial_string = %s", our_serial_str, bkpinfo->serial_string); 2581 if (cd_number > 0 && !strcmp(our_serial_str, bkpinfo->serial_string)) { 2588 2582 mds = media_descriptor_string(g_backup_media_type); 2589 2583 log_msg(2, "This %s is part of this backup set!", mds); -
branches/3.3/mondo/src/common/libmondo-tools.c
r3836 r3856 56 56 */ 57 57 extern char *g_mondo_home; 58 59 /**60 * The serial string (used to differentiate between backups) of the current backup.61 */62 extern char *g_serial_string;63 58 64 59 /** … … 1359 1354 malloc_string(g_boot_mountpt); 1360 1355 malloc_string(g_mondo_home); 1361 malloc_string(g_serial_string);1362 1356 malloc_string(g_magicdev_command); 1363 1357 } else { … … 1365 1359 paranoid_free(g_mondo_home); 1366 1360 paranoid_free(g_magicdev_command); 1367 1368 mr_free(g_serial_string);1369 1361 } 1370 1362 } -
branches/3.3/mondo/src/common/mondostructures.h
r3838 r3856 654 654 t_boot boot_type; 655 655 656 /** 657 * The serial string (used to differentiate between backups) 658 * of the current backup. 659 */ 660 char *serial_string; 656 661 }; 657 662 -
branches/3.3/mondo/src/common/newt-specific.c
r3854 r3856 442 442 mr_free(bkpinfo->prefix); 443 443 mr_free(bkpinfo->isodir); 444 mr_free(bkpinfo->serial_string); 444 445 /* Then free the structure */ 445 446 paranoid_free(bkpinfo);
Note:
See TracChangeset
for help on using the changeset viewer.