Changeset 3833 in MondoRescue
- Timestamp:
- Mar 5, 2024, 1:24:48 AM (5 months ago)
- Location:
- branches/3.3/mondo/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/common/libmondo-tools.c
r3830 r3833 710 710 711 711 char *tmp = NULL; 712 char *p = NULL; 713 714 if (bkpinfo->tmpdir[0] != '\0') { 712 713 if (bkpinfo->tmpdir != NULL) { 715 714 /* purging a potential old tmpdir */ 716 715 if (chdir("/tmp")) { … … 744 743 mr_asprintf(tmp, "/tmp/mondo.tmp.XXXXXX"); 745 744 } 746 p= mkdtemp(tmp);747 if ( p== NULL) {745 bkpinfo->tmpdir = mkdtemp(tmp); 746 if (bkpinfo->tmpdir == NULL) { 748 747 printf("Failed to create global tmp directory %s for Mondo.",tmp); 749 748 mr_free(tmp); 750 749 finish(-1); 751 750 } 752 strcpy(bkpinfo->tmpdir,p);753 mr_free(tmp);754 755 751 log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir); 756 757 752 mr_system("mkdir -p %s/tmpfs", bkpinfo->tmpdir); 758 753 } … … 833 828 834 829 /* We need tmpdir as early as possible for further function calls */ 835 bkpinfo->tmpdir [0] = '\0'; // Really setup after830 bkpinfo->tmpdir = NULL; // Really setup after 836 831 bkpinfo->scratchdir[0] = '\0'; // Really setup after 837 832 setup_tmpdir(NULL); -
branches/3.3/mondo/src/common/mondostructures.h
r3830 r3833 489 489 * of space here. 490 490 */ 491 char tmpdir[MAX_STR_LEN / 4];491 char *tmpdir; 492 492 493 493 /** -
branches/3.3/mondo/src/common/newt-specific.c
r3830 r3833 402 402 mr_free(command); 403 403 } 404 if (bkpinfo->tmpdir ) {404 if (bkpinfo->tmpdir != NULL) { 405 405 log_msg(8,"tempdir is %s",bkpinfo->tmpdir); 406 406 if (strstr(bkpinfo->tmpdir ,"mondo.tmp.") != NULL) { … … 439 439 mr_free(bkpinfo->zip_exe); 440 440 mr_free(bkpinfo->zip_suffix); 441 mr_free(bkpinfo->tmpdir); 441 442 /* Then free the structure */ 442 443 paranoid_free(bkpinfo); -
branches/3.3/mondo/src/mondorestore/mondo-rstr-tools.c
r3830 r3833 1819 1819 void setup_MR_global_filenames() 1820 1820 { 1821 char *temppath;1822 1823 1821 assert(bkpinfo != NULL); 1824 1822 … … 1833 1831 malloc_string(g_isodir_format); 1834 1832 1835 temppath = bkpinfo->tmpdir; 1836 1837 sprintf(g_biggielist_txt, "%s/%s", temppath, BIGGIELIST_TXT_STUB); 1838 sprintf(g_filelist_full, "%s/%s", temppath, FILELIST_FULL_STUB); 1839 sprintf(g_filelist_imagedevs, "%s/tmp/filelist.imagedevs", temppath); 1840 // sprintf(g_imagedevs_pot, "%s/tmp/imagedevs.pot", temppath); 1833 sprintf(g_biggielist_txt, "%s/%s", bkpinfo->tmpdir, BIGGIELIST_TXT_STUB); 1834 sprintf(g_filelist_full, "%s/%s", bkpinfo->tmpdir, FILELIST_FULL_STUB); 1835 sprintf(g_filelist_imagedevs, "%s/tmp/filelist.imagedevs", bkpinfo->tmpdir); 1836 // sprintf(g_imagedevs_pot, "%s/tmp/imagedevs.pot", bkpinfo->tmpdir); 1841 1837 sprintf(g_imagedevs_restthese, "%s/tmp/imagedevs.restore-these", 1842 temppath);1838 bkpinfo->tmpdir); 1843 1839 if (bkpinfo->disaster_recovery) { 1844 1840 sprintf(g_mondo_cfg_file, "/%s", MONDO_CFG_FILE_STUB); 1845 1841 sprintf(g_mountlist_fname, "/%s", MOUNTLIST_FNAME_STUB); 1846 1842 } else { 1847 sprintf(g_mondo_cfg_file, "%s/%s", temppath, MONDO_CFG_FILE_STUB);1848 sprintf(g_mountlist_fname, "%s/%s", temppath, MOUNTLIST_FNAME_STUB);1843 sprintf(g_mondo_cfg_file, "%s/%s", bkpinfo->tmpdir, MONDO_CFG_FILE_STUB); 1844 sprintf(g_mountlist_fname, "%s/%s", bkpinfo->tmpdir, MOUNTLIST_FNAME_STUB); 1849 1845 } 1850 1846 } -
branches/3.3/mondo/src/mondorestore/mondorestore.c
r3832 r3833 2820 2820 2821 2821 log_msg(2, "Still here. Yay."); 2822 if (( strlen(bkpinfo->tmpdir) > 0) && (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL)) {2822 if ((bkpinfo->tmpdir != NULL) && (strlen(bkpinfo->tmpdir) > 0) && (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL)) { 2823 2823 mr_asprintf(tmp, "rm -Rf %s/*", bkpinfo->tmpdir); 2824 2824 run_program_and_log_output(tmp, FALSE);
Note:
See TracChangeset
for help on using the changeset viewer.