Changeset 1137 in MondoRescue
- Timestamp:
- Feb 11, 2007, 2:38:01 PM (18 years ago)
- Location:
- branches/stable/mondo/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-archive.c
r1136 r1137 1721 1721 char *message_to_screen; 1722 1722 char *sz_blank_disk; 1723 char *fnam; 1724 char *tmp2; 1725 char *tmp3; 1723 char *tmp2 = NULL; 1724 char *tmp3 = NULL; 1726 1725 bool cd_is_mountable; 1727 1726 … … 1730 1729 malloc_string(message_to_screen); 1731 1730 malloc_string(sz_blank_disk); 1732 malloc_string(fnam);1733 1731 tmp = mr_malloc(1200); 1734 tmp2 = mr_malloc(1200);1735 tmp3 = mr_malloc(1200);1736 1732 assert(bkpinfo != NULL); 1737 1733 assert_string_is_neither_NULL_nor_zerolength(destfile); 1738 1734 1739 1735 sprintf(tmp, "%s/isolinux.bin", bkpinfo->scratchdir); 1740 sprintf(tmp2, "%s/isolinux.bin", bkpinfo->tmpdir);1736 mr_asprintf(&tmp2, "%s/isolinux.bin", bkpinfo->tmpdir); 1741 1737 if (does_file_exist(tmp)) { 1742 sprintf(tmp3, "cp -f %s %s", tmp, tmp2);1738 mr_asprintf(&tmp3, "cp -f %s %s", tmp, tmp2); 1743 1739 paranoid_system(tmp3); 1740 mr_free(tmp3); 1744 1741 } 1745 1742 if (!does_file_exist(tmp) && does_file_exist(tmp2)) { 1746 sprintf(tmp3, "cp -f %s %s", tmp2, tmp);1743 mr_asprintf(&tmp3, "cp -f %s %s", tmp2, tmp); 1747 1744 paranoid_system(tmp3); 1748 } 1749 /* 1750 if (!does_file_exist(tmp)) 1751 { 1752 mr_msg (2, "Silly bug in Mindi.pl; workaround in progress..."); 1753 strcpy(fnam, call_program_and_get_last_line_of_output("locate isolinux.bin | tail -n1")); 1754 if (strlen(fnam)>0 && does_file_exist(fnam)) 1755 { 1756 sprintf(tmp, "cp -f %s %s", fnam, bkpinfo->scratchdir); 1757 res = run_program_and_log_output(tmp, FALSE); 1758 } 1759 else 1760 { 1761 res = 1; 1762 } 1763 if (res) 1764 { 1765 mr_msg (2, "Could not work around silly bug in Mindi.pl - sorry! Isolinux.bin missing"); 1766 } 1767 } 1768 */ 1745 mr_free(tmp3); 1746 } 1769 1747 mr_free(tmp2); 1770 mr_free(tmp3);1771 1748 if (bkpinfo->backup_media_type == iso && bkpinfo->manual_cd_tray) { 1772 1749 popup_and_OK(_("Please insert new media and press Enter.")); … … 1950 1927 mr_msg(1, "make_cd_use_lilo = FALSE"); 1951 1928 mr_msg(1, "Isolinux"); 1952 res = 1953 eval_call_to_make_ISO(bkpinfo,1954 "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",1955 destfile,g_current_media_number,1956 1957 1929 res = eval_call_to_make_ISO(bkpinfo, 1930 "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", 1931 destfile, 1932 g_current_media_number, 1933 MONDO_LOGFILE, 1934 message_to_screen); 1958 1935 } 1959 1936 } … … 2022 1999 mr_free(message_to_screen); 2023 2000 mr_free(sz_blank_disk); 2024 mr_free(fnam);2025 mr_free(tmp);2026 2001 return (retval); 2027 2002 } … … 2033 2008 char *command; 2034 2009 malloc_string(tmp); 2035 2036 malloc_string(command); 2037 sprintf(command, 2038 "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", 2039 bigfile_fname); 2010 bool ret = TRUE; 2011 mr_asprintf(&command, 2012 "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", 2013 bigfile_fname); 2040 2014 mr_msg(1, "command = '%s'", command); 2041 2015 strcpy(tmp, call_program_and_get_last_line_of_output(command)); 2042 2016 mr_msg(1, "--> tmp = '%s'", tmp); 2017 mr_free(command); 2043 2018 if (strstr(tmp, "NTFS")) { 2044 2019 iamhere("TRUE"); 2045 return (TRUE);2046 2020 } else { 2047 2021 iamhere("FALSE"); 2048 return (FALSE); 2049 } 2022 ret = FALSE; 2023 } 2024 return(ret); 2050 2025 } 2051 2026 -
branches/stable/mondo/src/common/libmondo-files.c
r1120 r1137 211 211 void exclude_nonexistent_files(char *inout) 212 212 { 213 char infname[MAX_STR_LEN];214 char outfname[MAX_STR_LEN];215 char tmp[MAX_STR_LEN];216 char incoming[MAX_STR_LEN];213 char *infname = NULL; 214 char *outfname = NULL; 215 char *tmp = NULL; 216 char *incoming = NULL; 217 217 218 218 /*@ int ********************************************************* */ -
branches/stable/mondo/src/include/mr_file.h
r1133 r1137 19 19 #define mr_fopen(x,y) mr_fopen_int((const char *)x, (const char *)y,__LINE__,__FILE__) 20 20 #define mr_fprintf(x,y,args...) mr_fprintf_int(x,__LINE__,__FILE__,y,## args) 21 #define mr_fclose(x) mr_fclose_int((FILE **)& fd, __LINE__,__FILE__)22 #define mr_mkdir(x ) mr_mkdir_int((const char *)pathname,(mode_t)mode,__LINE__,__FILE__)21 #define mr_fclose(x) mr_fclose_int((FILE **)&x, __LINE__,__FILE__) 22 #define mr_mkdir(x,y) mr_mkdir_int((const char *)x,(mode_t)y,__LINE__,__FILE__) 23 23 24 24 extern FILE *mr_fopen_int(const char *path, const char *mode,int line, char *file);
Note:
See TracChangeset
for help on using the changeset viewer.