Changeset 3060 in MondoRescue for branches/3.0/mondo/src/mondorestore/mondorestore.c
- Timestamp:
- Nov 10, 2012, 5:05:37 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/mondorestore/mondorestore.c
r3056 r3060 767 767 int retval = 0; 768 768 int res = 0; 769 bool boot_loader_installed = FALSE;770 769 /** malloc **/ 771 770 char tmp[MAX_STR_LEN]; … … 846 845 log_to_screen("Preparing to format your disk(s)"); 847 846 sleep(1); 848 system("sync");847 paranoid_system("sync"); 849 848 log_to_screen("Please wait. This may take a few minutes."); 850 849 res += format_everything(mountlist, FALSE, raidlist); … … 881 880 log_msg(1, 882 881 "Great! Boot loader was installed. No need for msg at end."); 883 boot_loader_installed = TRUE;884 882 } 885 883 clean_blkid(); … … 919 917 } 920 918 g_I_have_just_nuked = TRUE; 921 /*922 if (!boot_loader_installed && !does_file_exist(DO_MBR_PLEASE))923 {924 log_to_screen("PLEASE RUN 'mondorestore --mbr' NOW TO INITIALIZE YOUR BOOT SECTOR");925 write_one_liner_data_file(DO_MBR_PLEASE, "mondorestore --mbr");926 }927 */928 919 return (retval); 929 920 } … … 1063 1054 *ntfsprog_command, *suffix, *sz_devfile; 1064 1055 char *bigblk; 1065 char *p;1066 1056 char *mds = NULL; 1067 1057 int retval = 0; … … 1116 1106 bigfileno + 1); 1117 1107 log_msg(3, tmp); 1118 p = checksum;1119 1108 } 1120 1109 … … 1344 1333 1345 1334 if (strcmp(outfile_fname, "/dev/null")) { 1346 chown(outfile_fname, biggiestruct.properties.st_uid, 1347 biggiestruct.properties.st_gid); 1335 if (chown(outfile_fname, biggiestruct.properties.st_uid, 1336 biggiestruct.properties.st_gid)) { 1337 // FIXME 1338 } 1348 1339 chmod(outfile_fname, biggiestruct.properties.st_mode); 1349 1340 ubuf->actime = biggiestruct.properties.st_atime; … … 1615 1606 if (strcmp(outfile_fname, "/dev/null")) { 1616 1607 chmod(outfile_fname, biggiestruct.properties.st_mode); 1617 chown(outfile_fname, biggiestruct.properties.st_uid, 1618 biggiestruct.properties.st_gid); 1608 if (chown(outfile_fname, biggiestruct.properties.st_uid, 1609 biggiestruct.properties.st_gid)) { 1610 // FIXME 1611 } 1619 1612 ubuf->actime = biggiestruct.properties.st_atime; 1620 1613 ubuf->modtime = biggiestruct.properties.st_mtime; … … 1831 1824 if (retval) { 1832 1825 mr_asprintf(&command, "cat %s >> %s", temp_log, MONDO_LOGFILE); 1833 system(command);1826 paranoid_system(command); 1834 1827 paranoid_free(command); 1835 1828 … … 2580 2573 max_val = atol(tmp) + 1; 2581 2574 2582 chdir(bkpinfo->restore_path); /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */ 2575 if (chdir(bkpinfo->restore_path)) { /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */ 2576 //FIXME 2577 } 2583 2578 2584 2579 run_program_and_log_output("pwd", 5); … … 2708 2703 log_msg(2, "restore_everything() --- starting"); 2709 2704 g_current_media_number = 1; 2710 getcwd(cwd, MAX_STR_LEN - 1); 2705 if (getcwd(cwd, MAX_STR_LEN - 1)) { 2706 // FIXME 2707 } 2711 2708 sprintf(tmp, "mkdir -p %s", bkpinfo->restore_path); 2712 2709 run_program_and_log_output(tmp, FALSE); 2713 2710 log_msg(1, "Changing dir to %s", bkpinfo->restore_path); 2714 chdir(bkpinfo->restore_path); 2715 getcwd(newpath, MAX_STR_LEN - 1); 2711 if (chdir(bkpinfo->restore_path)) { 2712 //FIXME 2713 } 2714 if (getcwd(newpath, MAX_STR_LEN - 1)) { 2715 // FIXME 2716 } 2716 2717 log_msg(1, "path is now %s", newpath); 2717 2718 log_msg(1, "restoring everything"); … … 2745 2746 resB = restore_all_biggiefiles_from_CD(filelist); 2746 2747 } 2747 chdir(cwd); 2748 if (chdir(cwd)) { 2749 //FIXME 2750 } 2748 2751 if (resA + resB) { 2749 2752 log_to_screen("Errors occurred while data was being restored."); … … 2936 2939 if (argc == 2 && strcmp(argv[1], "--edit-mountlist") == 0) { 2937 2940 #ifdef __FreeBSD__ 2938 system("mv -f /tmp/raidconf.txt /etc/raidtab");2941 paranoid_system("mv -f /tmp/raidconf.txt /etc/raidtab"); 2939 2942 if (!does_file_exist("/etc/raidtab")) 2940 system("vinum printconfig > /etc/raidtab");2943 paranoid_system("vinum printconfig > /etc/raidtab"); 2941 2944 #endif 2942 2945 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); … … 2946 2949 res = let_user_edit_the_mountlist(mountlist, raidlist); 2947 2950 #ifdef __FreeBSD__ 2948 system("mv -f /etc/raidtab /tmp/raidconf.txt");2951 paranoid_system("mv -f /etc/raidtab /tmp/raidconf.txt"); 2949 2952 #endif 2950 2953 paranoid_MR_finish(res); … … 2959 2962 if (argc >= 2 && strcmp(argv[1], "--pih") == 0) { 2960 2963 if (system("mount | grep cdrom 2> /dev/null > /dev/null")) { 2961 system("mount " MNT_CDROM);2964 paranoid_system("mount " MNT_CDROM); 2962 2965 } 2963 2966 bkpinfo->compression_level = 1; … … 2969 2972 "Please wait. This may take some time.", 2970 2973 "", 1999); 2971 system("rm -Rf /tmp/*pih*");2974 paranoid_system("rm -Rf /tmp/*pih*"); 2972 2975 2973 2976 restore_a_biggiefile_from_CD(42, NULL, tmp); … … 3269 3272 if (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL) { 3270 3273 sprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 3271 system(tmp);3274 paranoid_system(tmp); 3272 3275 } 3273 3276 paranoid_MR_finish(retval); // frees global stuff plus bkpinfo
Note:
See TracChangeset
for help on using the changeset viewer.