- Timestamp:
- Mar 4, 2024, 4:52:07 PM (15 months ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-tools.c
r3827 r3828 850 850 bkpinfo->include_paths = NULL; 851 851 bkpinfo->exclude_devs = NULL; 852 bkpinfo->restore_path [0] = '\0';852 bkpinfo->restore_path = NULL; 853 853 bkpinfo->call_before_iso = NULL; 854 854 bkpinfo->call_make_iso = NULL; -
branches/3.3/mondo/src/common/libmondo-verify.c
r3613 r3828 295 295 paranoid_fclose(fin); 296 296 } 297 if (bkpinfo->restore_path ) {297 if (bkpinfo->restore_path != NULL) { 298 298 mr_asprintf(tmp, "%s/%s", bkpinfo->restore_path, biggiestruct.filename); 299 299 log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp); … … 869 869 mr_free(comment); 870 870 871 if (bkpinfo->restore_path ) {871 if (bkpinfo->restore_path != NULL) { 872 872 mr_asprintf(logical_fname, "%s/%s", bkpinfo->restore_path, orig_fname); 873 873 res = verify_a_biggiefile_from_stream(logical_fname, size); -
branches/3.3/mondo/src/common/mondostructures.h
r3827 r3828 535 535 * without overwriting the old ones. Ignored during a backup. 536 536 */ 537 char restore_path[MAX_STR_LEN];537 char *restore_path; 538 538 539 539 /** -
branches/3.3/mondo/src/common/newt-specific.c
r3827 r3828 435 435 mr_free(bkpinfo->call_after_iso); 436 436 mr_free(bkpinfo->call_before_iso); 437 mr_free(bkpinfo->restore_path); 437 438 /* Then free the structure */ 438 439 paranoid_free(bkpinfo); -
branches/3.3/mondo/src/mondorestore/mondorestore.c
r3822 r3828 1854 1854 log_msg(2, "interactive_mode --- starting (great, assertions OK)"); 1855 1855 1856 malloc_string(tmp);1857 1856 assert(bkpinfo != NULL); 1858 1857 assert(mountlist != NULL); … … 1962 1961 if (!ask_me_yes_or_no("Re-edit the mountlist?")) { 1963 1962 retval++; 1964 goto end_of_func; 1963 log_it("Leaving interactive_mode()"); 1964 return (retval); 1965 1965 } 1966 1966 } … … 1972 1972 unmount_all_devices(mountlist); 1973 1973 retval++; 1974 goto end_of_func; 1974 log_it("Leaving interactive_mode()"); 1975 return (retval); 1975 1976 } 1976 1977 … … 1988 1989 */ 1989 1990 if (filelist) { 1990 1991 strcpy(tmp, old_restpath);1992 // (NB: %s is where your filesystem is mounted now, by default)", MNT_RESTORING);1993 if ( popup_and_get_string("Restore path", "Restore files to where?", tmp, MAX_STR_LEN / 4)) {1991 gotos_suck: 1992 // (NB: MNT_RESTORING is where your filesystem is mounted now, by default) 1993 tmp = mr_popup_and_get_string("Restore path", "Restore files to where?", old_restpath); 1994 if (tmp != NULL) { 1994 1995 if (!strcmp(tmp, "/")) { 1995 1996 if (!ask_me_yes_or_no("Are you sure?")) { 1997 mr_free(tmp); 1996 1998 goto gotos_suck; 1997 1999 } 1998 tmp[0] = '\0'; // so we restore to [blank]/file/name :)2000 mr_asprintf(tmp, "%s", ""); // so we restore to [blank]/file/name :) 1999 2001 } 2000 strcpy(bkpinfo->restore_path, tmp);2002 mr_asprintf(bkpinfo->restore_path, "%s", tmp); 2001 2003 log_msg(1, "Restoring subset"); 2002 2004 retval += restore_everything(filelist); 2003 free_filelist(filelist);2004 2005 } else { 2005 strcpy(bkpinfo->restore_path, old_restpath);2006 free_filelist(filelist);2006 mr_free(bkpinfo->restore_path); 2007 mr_asprintf(bkpinfo->restore_path, "%s", old_restpath); 2007 2008 } 2009 free_filelist(filelist); 2008 2010 if (!ask_me_yes_or_no("Restore another subset of your backup?")) { 2009 2011 done = TRUE; … … 2063 2065 } 2064 2066 end_of_func: 2065 paranoid_free(tmp);2066 2067 log_it("Leaving interactive_mode()"); 2067 2068 return (retval); … … 2453 2454 2454 2455 char *old_restpath = NULL; 2456 char *tmp2 = NULL; 2455 2457 2456 2458 struct mountlist_itself *mountlist = NULL; … … 2466 2468 } 2467 2469 2468 strcpy(bkpinfo->restore_path, "/");2470 mr_asprintf(bkpinfo->restore_path, "%s", "/"); 2469 2471 if (!g_restoring_live_from_cd && !g_restoring_live_from_netfs) { 2470 2472 popup_and_OK("Please insert tape/CD/USB Key, then hit 'OK' to continue."); … … 2496 2498 save_filelist(filelist, "/tmp/selected-files.txt"); 2497 2499 mr_asprintf(old_restpath, "%s", bkpinfo->restore_path); 2498 if (popup_and_get_string("Restore path", "Restore files to where? ", bkpinfo->restore_path, MAX_STR_LEN / 4)) { 2500 tmp2 = mr_popup_and_get_string("Restore path", "Restore files to where? ", bkpinfo->restore_path); 2501 mr_free(bkpinfo->restore_path); 2502 if (tmp2 == NULL) { 2499 2503 log_it("Restoring everything"); 2500 2504 retval += restore_everything(filelist); 2501 free_filelist(filelist); 2502 strcpy(bkpinfo->restore_path, old_restpath); 2505 mr_asprintf(bkpinfo->restore_path, "%s", old_restpath); 2503 2506 } else { 2504 free_filelist(filelist);2505 } 2506 strcpy(bkpinfo->restore_path, old_restpath);2507 bkpinfo->restore_path = tmp2; 2508 } 2509 free_filelist(filelist); 2507 2510 mr_free(old_restpath); 2508 2511 } else { … … 2829 2832 2830 2833 log_it("About to call load_mountlist and load_raidtab"); 2831 strcpy(bkpinfo->restore_path, MNT_RESTORING);2834 mr_asprintf(bkpinfo->restore_path, "%s", MNT_RESTORING); 2832 2835 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 2833 2836 retval = load_mountlist(mountlist, g_mountlist_fname);
Note:
See TracChangeset
for help on using the changeset viewer.