Changeset 3856 in MondoRescue
- Timestamp:
- Mar 6, 2024, 5:29:44 PM (2 months ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 5 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); -
branches/3.3/mondo/src/mondorestore/mondo-rstr-newt.c
r3614 r3856 1436 1436 for (;;) { 1437 1437 int i; 1438 char headerstr[MAX_STR_LEN]; 1439 snprintf(headerstr, MAX_STR_LEN, "%-14s %-8s %11s %8s", 1440 "Plex", "Level", "Stripe Size", "Subdisks"); 1438 char *headerstr = NULL; 1439 mr_asprintf(headerstr, "%-14s %-8s %11s %8s", "Plex", "Level", "Stripe Size", "Subdisks"); 1441 1440 1442 1441 bOK = newtCompactButton(2, 13, " OK "); … … 1449 1448 newtListbox(2, 3, 9, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); 1450 1449 plexesHeader = newtLabel(2, 2, headerstr); 1450 mr_free(headerstr); 1451 1451 editraidForm = newtForm(NULL, NULL, 0); 1452 1452 … … 1455 1455 keylist[i] = (void *) i; 1456 1456 if (i < raidrec->plexes) { 1457 char pname[64], entry[MAX_STR_LEN]; 1457 char *pname; 1458 char *entry; 1458 1459 switch (raidrec->plex[i].raidlevel) { 1459 1460 case -1: … … 1476 1477 mr_asprintf(chunksize, "%dk", raidrec->plex[i].stripesize); 1477 1478 } 1478 snprintf(pname, 64, "%s.p%i", raidrec->volname, i); 1479 snprintf(entry, MAX_STR_LEN, "%-14s %-8s %11s %8d", 1480 pname, raidlevel, chunksize, 1481 raidrec->plex[i].subdisks); 1479 mr_asprintf(pname, "%s.p%i", raidrec->volname, i); 1480 mr_asprintf(entry, "%-14s %-8s %11s %8d", pname, raidlevel, chunksize, raidrec->plex[i].subdisks); 1481 mr_free(pname); 1482 1482 mr_free(raidlevel); 1483 1483 mr_free(chunksize); 1484 1484 1485 1485 newtListboxAppendEntry(plexesListbox, entry, keylist[i]); 1486 mr_free(entry); 1486 1487 } 1487 1488 }
Note:
See TracChangeset
for help on using the changeset viewer.