Changeset 783 in MondoRescue
- Timestamp:
- Aug 31, 2006, 5:09:20 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 42 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/Doxyfile
r30 r783 1 # Doxyfile 1.3.21 # Generated by doxygen 1.4.4 2 2 3 #--------------------------------------------------------------------------- 4 # General configuration options 5 #--------------------------------------------------------------------------- 6 PROJECT_NAME = "Mondo Rescue" 7 PROJECT_NUMBER = 2.0x 8 OUTPUT_DIRECTORY = doc 9 OUTPUT_LANGUAGE = English 10 USE_WINDOWS_ENCODING = NO 11 EXTRACT_ALL = NO 12 EXTRACT_PRIVATE = NO 13 EXTRACT_STATIC = NO 14 EXTRACT_LOCAL_CLASSES = YES 15 HIDE_UNDOC_MEMBERS = NO 16 HIDE_UNDOC_CLASSES = NO 17 HIDE_FRIEND_COMPOUNDS = NO 18 HIDE_IN_BODY_DOCS = YES 19 BRIEF_MEMBER_DESC = YES 20 REPEAT_BRIEF = YES 21 ALWAYS_DETAILED_SEC = YES 22 INLINE_INHERITED_MEMB = NO 23 FULL_PATH_NAMES = NO 24 STRIP_FROM_PATH = 25 INTERNAL_DOCS = NO 26 CASE_SENSE_NAMES = YES 27 SHORT_NAMES = NO 28 HIDE_SCOPE_NAMES = NO 29 SHOW_INCLUDE_FILES = YES 30 JAVADOC_AUTOBRIEF = YES 31 MULTILINE_CPP_IS_BRIEF = NO 32 DETAILS_AT_TOP = NO 33 INHERIT_DOCS = YES 34 INLINE_INFO = YES 35 SORT_MEMBER_DOCS = YES 36 DISTRIBUTE_GROUP_DOC = NO 37 TAB_SIZE = 4 38 GENERATE_TODOLIST = YES 39 GENERATE_TESTLIST = YES 40 GENERATE_BUGLIST = YES 41 GENERATE_DEPRECATEDLIST= YES 42 ALIASES = 43 ENABLED_SECTIONS = 44 MAX_INITIALIZER_LINES = 30 45 OPTIMIZE_OUTPUT_FOR_C = YES 46 OPTIMIZE_OUTPUT_JAVA = NO 47 SHOW_USED_FILES = YES 48 #--------------------------------------------------------------------------- 49 # configuration options related to warning and progress messages 50 #--------------------------------------------------------------------------- 51 QUIET = NO 52 WARNINGS = YES 53 WARN_IF_UNDOCUMENTED = YES 54 WARN_IF_DOC_ERROR = YES 55 WARN_FORMAT = "$file:$line: $text" 56 WARN_LOGFILE = 57 #--------------------------------------------------------------------------- 58 # configuration options related to the input files 59 #--------------------------------------------------------------------------- 60 INPUT = mondo/mondo.dox \ 61 mondo/common/ \ 62 mondo/mondoarchive/ \ 63 mondo/mondorestore/ 64 FILE_PATTERNS = *.c \ 65 m*.h 66 RECURSIVE = YES 67 EXCLUDE = 68 EXCLUDE_SYMLINKS = NO 69 EXCLUDE_PATTERNS = 70 EXAMPLE_PATH = 71 EXAMPLE_PATTERNS = 72 EXAMPLE_RECURSIVE = NO 73 IMAGE_PATH = 74 INPUT_FILTER = 75 FILTER_SOURCE_FILES = NO 76 #--------------------------------------------------------------------------- 77 # configuration options related to source browsing 78 #--------------------------------------------------------------------------- 79 SOURCE_BROWSER = YES 80 INLINE_SOURCES = NO 81 STRIP_CODE_COMMENTS = YES 82 REFERENCED_BY_RELATION = YES 83 REFERENCES_RELATION = YES 84 VERBATIM_HEADERS = YES 85 #--------------------------------------------------------------------------- 86 # configuration options related to the alphabetical class index 87 #--------------------------------------------------------------------------- 88 ALPHABETICAL_INDEX = NO 89 COLS_IN_ALPHA_INDEX = 5 90 IGNORE_PREFIX = 91 #--------------------------------------------------------------------------- 92 # configuration options related to the HTML output 93 #--------------------------------------------------------------------------- 94 GENERATE_HTML = YES 95 HTML_OUTPUT = html 96 HTML_FILE_EXTENSION = .html 97 HTML_HEADER = 98 HTML_FOOTER = 99 HTML_STYLESHEET = 100 HTML_ALIGN_MEMBERS = YES 101 GENERATE_HTMLHELP = NO 102 CHM_FILE = 103 HHC_LOCATION = 104 GENERATE_CHI = NO 105 BINARY_TOC = NO 106 TOC_EXPAND = NO 107 DISABLE_INDEX = NO 108 ENUM_VALUES_PER_LINE = 4 109 GENERATE_TREEVIEW = YES 110 TREEVIEW_WIDTH = 250 111 #--------------------------------------------------------------------------- 112 # configuration options related to the LaTeX output 113 #--------------------------------------------------------------------------- 114 GENERATE_LATEX = YES 115 LATEX_OUTPUT = latex 116 LATEX_CMD_NAME = latex 117 MAKEINDEX_CMD_NAME = makeindex 118 COMPACT_LATEX = NO 119 PAPER_TYPE = a4wide 120 EXTRA_PACKAGES = 121 LATEX_HEADER = 122 PDF_HYPERLINKS = NO 123 USE_PDFLATEX = NO 124 LATEX_BATCHMODE = NO 125 LATEX_HIDE_INDICES = NO 126 #--------------------------------------------------------------------------- 127 # configuration options related to the RTF output 128 #--------------------------------------------------------------------------- 129 GENERATE_RTF = NO 130 RTF_OUTPUT = rtf 131 COMPACT_RTF = NO 132 RTF_HYPERLINKS = NO 133 RTF_STYLESHEET_FILE = 134 RTF_EXTENSIONS_FILE = 135 #--------------------------------------------------------------------------- 136 # configuration options related to the man page output 137 #--------------------------------------------------------------------------- 138 GENERATE_MAN = YES 139 MAN_OUTPUT = man 140 MAN_EXTENSION = .3 141 MAN_LINKS = NO 142 #--------------------------------------------------------------------------- 143 # configuration options related to the XML output 144 #--------------------------------------------------------------------------- 145 GENERATE_XML = YES 146 XML_OUTPUT = xml 147 XML_SCHEMA = 148 XML_DTD = 149 #--------------------------------------------------------------------------- 150 # configuration options for the AutoGen Definitions output 151 #--------------------------------------------------------------------------- 152 GENERATE_AUTOGEN_DEF = NO 153 #--------------------------------------------------------------------------- 154 # configuration options related to the Perl module output 155 #--------------------------------------------------------------------------- 156 GENERATE_PERLMOD = NO 157 PERLMOD_LATEX = NO 158 PERLMOD_PRETTY = YES 159 PERLMOD_MAKEVAR_PREFIX = 160 #--------------------------------------------------------------------------- 161 # Configuration options related to the preprocessor 162 #--------------------------------------------------------------------------- 163 ENABLE_PREPROCESSING = YES 164 MACRO_EXPANSION = NO 165 EXPAND_ONLY_PREDEF = NO 166 SEARCH_INCLUDES = YES 167 INCLUDE_PATH = 168 INCLUDE_FILE_PATTERNS = 169 PREDEFINED = linux 170 EXPAND_AS_DEFINED = 171 SKIP_FUNCTION_MACROS = YES 172 #--------------------------------------------------------------------------- 173 # Configuration::addtions related to external references 174 #--------------------------------------------------------------------------- 175 TAGFILES = 176 GENERATE_TAGFILE = 177 ALLEXTERNALS = NO 178 EXTERNAL_GROUPS = YES 179 PERL_PATH = /usr/bin/perl 180 #--------------------------------------------------------------------------- 181 # Configuration options related to the dot tool 182 #--------------------------------------------------------------------------- 183 CLASS_DIAGRAMS = YES 184 HIDE_UNDOC_RELATIONS = YES 185 HAVE_DOT = YES 186 CLASS_GRAPH = YES 187 COLLABORATION_GRAPH = YES 188 UML_LOOK = NO 189 TEMPLATE_RELATIONS = NO 190 INCLUDE_GRAPH = YES 191 INCLUDED_BY_GRAPH = YES 192 CALL_GRAPH = NO 193 GRAPHICAL_HIERARCHY = YES 194 DOT_IMAGE_FORMAT = png 195 DOT_PATH = 196 DOTFILE_DIRS = 197 MAX_DOT_GRAPH_WIDTH = 1024 198 MAX_DOT_GRAPH_HEIGHT = 1024 199 MAX_DOT_GRAPH_DEPTH = 0 200 GENERATE_LEGEND = YES 201 DOT_CLEANUP = YES 202 #--------------------------------------------------------------------------- 203 # Configuration::addtions related to the search engine 204 #--------------------------------------------------------------------------- 205 SEARCHENGINE = NO 206 CGI_NAME = search.cgi 207 CGI_URL = 208 DOC_URL = 209 DOC_ABSPATH = 210 BIN_ABSPATH = /usr/local/bin/ 211 EXT_DOC_PATHS = 3 # This file describes styles used for generating RTF output. 4 # All text after a hash (#) is considered a comment and will be ignored. 5 # Remove a hash to activate a line. 6 7 # Heading1 = \s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid \sbasedon0 \snext0 heading 1 8 # Heading2 = \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid \sbasedon0 \snext0 heading 2 9 # Heading3 = \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid \sbasedon0 \snext0 heading 3 10 # Heading4 = \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext0 heading 4;}{\*\cs10 \additive Default Paragraph Font 11 # Heading5 = \s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext0 heading 5;}{\*\cs10 \additive Default Paragraph Font 12 # Title = \s15\qc\sb240\sa60\widctlpar\outlinelevel0\adjustright \b\f1\fs32\kerning28\cgrid \sbasedon0 \snext15 Title 13 # SubTitle = \s16\qc\sa60\widctlpar\outlinelevel1\adjustright \f1\cgrid \sbasedon0 \snext16 Subtitle 14 # BodyText = \s17\sa60\sb30\widctlpar\qj \fs22\cgrid \sbasedon0 \snext17 BodyText 15 # DenseText = \s18\widctlpar\fs22\cgrid \sbasedon0 \snext18 DenseText 16 # Header = \s28\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext28 header 17 # Footer = \s29\widctlpar\tqc\tx4320\tqr\tx8640\qr\adjustright \fs20\cgrid \sbasedon0 \snext29 footer 18 # GroupHeader = \s30\li360\sa60\sb120\keepn\widctlpar\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext30 GroupHeader 19 # CodeExample0 = \s40\li0\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext41 Code Example 0 20 # CodeExample1 = \s41\li360\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext42 Code Example 1 21 # CodeExample2 = \s42\li720\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext43 Code Example 2 22 # CodeExample3 = \s43\li1080\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext44 Code Example 3 23 # CodeExample4 = \s44\li1440\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext45 Code Example 4 24 # CodeExample5 = \s45\li1800\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext46 Code Example 5 25 # CodeExample6 = \s46\li2160\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext47 Code Example 6 26 # CodeExample7 = \s47\li2520\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext48 Code Example 7 27 # CodeExample8 = \s48\li2880\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext49 Code Example 8 28 # CodeExample9 = \s49\li3240\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext49 Code Example 9 29 # ListContinue0 = \s50\li0\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext51 List Continue 0 30 # ListContinue1 = \s51\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext52 List Continue 1 31 # ListContinue2 = \s52\li720\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext53 List Continue 2 32 # ListContinue3 = \s53\li1080\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext54 List Continue 3 33 # ListContinue4 = \s54\li1440\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext55 List Continue 4 34 # ListContinue5 = \s55\li1800\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext56 List Continue 5 35 # ListContinue6 = \s56\li2160\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext57 List Continue 6 36 # ListContinue7 = \s57\li2520\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext58 List Continue 7 37 # ListContinue8 = \s58\li2880\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext59 List Continue 8 38 # ListContinue9 = \s59\li3240\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext59 List Continue 9 39 # DescContinue0 = \s60\li0\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext61 DescContinue 0 40 # DescContinue1 = \s61\li360\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext62 DescContinue 1 41 # DescContinue2 = \s62\li720\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext63 DescContinue 2 42 # DescContinue3 = \s63\li1080\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext64 DescContinue 3 43 # DescContinue4 = \s64\li1440\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext65 DescContinue 4 44 # DescContinue5 = \s65\li1800\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext66 DescContinue 5 45 # DescContinue6 = \s66\li2160\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext67 DescContinue 6 46 # DescContinue7 = \s67\li2520\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext68 DescContinue 7 47 # DescContinue8 = \s68\li2880\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext69 DescContinue 8 48 # DescContinue9 = \s69\li3240\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext69 DescContinue 9 49 # LatexTOC0 = \s70\li0\sa30\sb30\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext81 LatexTOC 0 50 # LatexTOC1 = \s71\li360\sa27\sb27\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext82 LatexTOC 1 51 # LatexTOC2 = \s72\li720\sa24\sb24\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext83 LatexTOC 2 52 # LatexTOC3 = \s73\li1080\sa21\sb21\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext84 LatexTOC 3 53 # LatexTOC4 = \s74\li1440\sa18\sb18\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext85 LatexTOC 4 54 # LatexTOC5 = \s75\li1800\sa15\sb15\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext86 LatexTOC 5 55 # LatexTOC6 = \s76\li2160\sa12\sb12\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext87 LatexTOC 6 56 # LatexTOC7 = \s77\li2520\sa9\sb9\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext88 LatexTOC 7 57 # LatexTOC8 = \s78\li2880\sa6\sb6\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext89 LatexTOC 8 58 # LatexTOC9 = \s79\li3240\sa3\sb3\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext89 LatexTOC 9 59 # ListBullet0 = \s80\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext81 \sautoupd List Bullet 0 60 # ListBullet1 = \s81\fi-360\li720\widctlpar\jclisttab\tx720{\*\pn \pnlvlbody\ilvl0\ls2\pnrnot0\pndec }\ls2\adjustright \fs20\cgrid \sbasedon0 \snext82 \sautoupd List Bullet 1 61 # ListBullet2 = \s82\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec }\ls3\adjustright \fs20\cgrid \sbasedon0 \snext83 \sautoupd List Bullet 2 62 # ListBullet3 = \s83\fi-360\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlbody\ilvl0\ls4\pnrnot0\pndec }\ls4\adjustright \fs20\cgrid \sbasedon0 \snext84 \sautoupd List Bullet 3 63 # ListBullet4 = \s84\fi-360\li1800\widctlpar\jclisttab\tx1800{\*\pn \pnlvlbody\ilvl0\ls5\pnrnot0\pndec }\ls5\adjustright \fs20\cgrid \sbasedon0 \snext85 \sautoupd List Bullet 4 64 # ListBullet5 = \s85\fi-360\li2160\widctlpar\jclisttab\tx2160{\*\pn \pnlvlbody\ilvl0\ls6\pnrnot0\pndec }\ls6\adjustright \fs20\cgrid \sbasedon0 \snext86 \sautoupd List Bullet 5 65 # ListBullet6 = \s86\fi-360\li2520\widctlpar\jclisttab\tx2520{\*\pn \pnlvlbody\ilvl0\ls7\pnrnot0\pndec }\ls7\adjustright \fs20\cgrid \sbasedon0 \snext87 \sautoupd List Bullet 6 66 # ListBullet7 = \s87\fi-360\li2880\widctlpar\jclisttab\tx2880{\*\pn \pnlvlbody\ilvl0\ls8\pnrnot0\pndec }\ls8\adjustright \fs20\cgrid \sbasedon0 \snext88 \sautoupd List Bullet 7 67 # ListBullet8 = \s88\fi-360\li3240\widctlpar\jclisttab\tx3240{\*\pn \pnlvlbody\ilvl0\ls9\pnrnot0\pndec }\ls9\adjustright \fs20\cgrid \sbasedon0 \snext89 \sautoupd List Bullet 8 68 # ListBullet9 = \s89\fi-360\li3600\widctlpar\jclisttab\tx3600{\*\pn \pnlvlbody\ilvl0\ls10\pnrnot0\pndec }\ls10\adjustright \fs20\cgrid \sbasedon0 \snext89 \sautoupd List Bullet 9 69 # ListEnum0 = \s90\fi-360\li360\widctlpar\fs20\cgrid \sbasedon0 \snext91 \sautoupd List Enum 0 70 # ListEnum1 = \s91\fi-360\li720\widctlpar\fs20\cgrid \sbasedon0 \snext92 \sautoupd List Enum 1 71 # ListEnum2 = \s92\fi-360\li1080\widctlpar\fs20\cgrid \sbasedon0 \snext93 \sautoupd List Enum 2 72 # ListEnum3 = \s93\fi-360\li1440\widctlpar\fs20\cgrid \sbasedon0 \snext94 \sautoupd List Enum 3 73 # ListEnum4 = \s94\fi-360\li1800\widctlpar\fs20\cgrid \sbasedon0 \snext95 \sautoupd List Enum 4 74 # ListEnum5 = \s95\fi-360\li2160\widctlpar\fs20\cgrid \sbasedon0 \snext96 \sautoupd List Enum 5 75 # ListEnum6 = \s96\fi-360\li2520\widctlpar\fs20\cgrid \sbasedon0 \snext96 \sautoupd List Enum 5 76 # ListEnum7 = \s97\fi-360\li2880\widctlpar\fs20\cgrid \sbasedon0 \snext98 \sautoupd List Enum 7 77 # ListEnum8 = \s98\fi-360\li3240\widctlpar\fs20\cgrid \sbasedon0 \snext99 \sautoupd List Enum 8 78 # ListEnum9 = \s99\fi-360\li3600\widctlpar\fs20\cgrid \sbasedon0 \snext99 \sautoupd List Enum 9 -
trunk/mondo/Makefile.am
r537 r783 6 6 7 7 EXTRA_DIST = config.rpath mkinstalldirs 8 9 -
trunk/mondo/configure.in
r561 r783 125 125 AC_TYPE_SIGNAL 126 126 AC_FUNC_VPRINTF 127 AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr getline asprintf trunc vasprintf])127 AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr strspn getline asprintf trunc vasprintf]) 128 128 129 AC_OUTPUT([Makefile mondo/Makefile mondo/common/Makefile mondo/ mondoarchive/Makefile mondo/mondorestore/Makefile mondo/restore-scripts/Makefile mondo/restore-scripts/mondo/Makefile mondo/restore-scripts/usr/Makefile mondo/restore-scripts/usr/bin/Makefile mondo/post-nuke.sample/Makefile mondo/post-nuke.sample/usr/Makefile mondo/post-nuke.sample/usr/bin/Makefile po/Makefile.in m4/Makefile])129 AC_OUTPUT([Makefile mondo/Makefile mondo/common/Makefile mondo/lib/Makefile mondo/mondoarchive/Makefile mondo/mondorestore/Makefile mondo/restore-scripts/Makefile mondo/restore-scripts/mondo/Makefile mondo/restore-scripts/usr/Makefile mondo/restore-scripts/usr/bin/Makefile mondo/post-nuke.sample/Makefile mondo/post-nuke.sample/usr/Makefile mondo/post-nuke.sample/usr/bin/Makefile]) -
trunk/mondo/mondo/Makefile.am
r764 r783 1 SUBDIRS = common mondoarchive mondorestore restore-scripts post-nuke.sample1 SUBDIRS = lib common mondoarchive mondorestore restore-scripts post-nuke.sample 2 2 DIST_SUBDIRS = ${SUBDIRS} 3 3 -
trunk/mondo/mondo/common/Makefile.am
r539 r783 2 2 ## Process this file with Automake to generate `Makefile.in' 3 3 ## 4 AM_CPPFLAGS = -DMONDO_SHARE=\"$(pkgdatadir)\" 4 AM_CPPFLAGS = -DMONDO_SHARE=\"$(pkgdatadir)\" -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/mondo/include 5 5 6 6 ## libmondo … … 8 8 9 9 libmondo_a_SOURCES = libmondo-archive.c libmondo-devices.c libmondo-fifo.c \ 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 10 libmondo-filelist.c libmondo-files.c libmondo-fork.c \ 11 libmondo-mountlist.c libmondo-raid.c libmondo-msg.c \ 12 libmondo-stream.c libmondo-string.c libmondo-tools.c \ 13 libmondo-verify.c newt-specific.c \ 14 libmondo-archive.h libmondo-devices.h \ 15 libmondo-filelist.h libmondo-files.h libmondo-fork.h \ 16 libmondo-mountlist.h libmondo-raid.h \ 17 libmondo-stream.h libmondo-string.h libmondo-tools.h \ 18 libmondo-verify.h libmondo-fifo.h \ 19 libmondo-archive-EXT.h my-stuff.h mondostructures.h \ 20 libmondo-devices-EXT.h libmondo-fifo-EXT.h \ 21 libmondo-files-EXT.h libmondo-fork-EXT.h \ 22 libmondo-filelist-EXT.h \ 23 libmondo-mountlist-EXT.h libmondo-raid-EXT.h \ 24 libmondo-string-EXT.h libmondo-tools-EXT.h \ 25 libmondo-verify-EXT.h libmondo-stream-EXT.h \ 26 newt-specific.h -
trunk/mondo/mondo/common/libmondo-archive-EXT.h
r539 r783 15 15 extern int make_slices_and_images(struct s_bkpinfo *bkpinfo, 16 16 char *biggielist_fname); 17 extern int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,char *destfile);17 extern int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile); 18 18 extern int make_afioballs_and_images(struct s_bkpinfo *bkpinfo); 19 19 extern int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...); -
trunk/mondo/mondo/common/libmondo-archive.c
r729 r783 10 10 */ 11 11 12 #include " ../common/my-stuff.h"12 #include "my-stuff.h" 13 13 #include "../common/mondostructures.h" 14 #include "mr_conf.h" 14 15 #include "libmondo-string-EXT.h" 15 16 #include "libmondo-stream-EXT.h" … … 80 81 */ 81 82 t_bkptype g_backup_media_type = none; 83 char *g_backup_media_string = NULL; 82 84 83 85 /** … … 231 233 log_msg(5, "command='%s'", command); 232 234 res = system(command); 233 tmp = last_line_of_file(MONDO_LOGFILE) );235 tmp = last_line_of_file(MONDO_LOGFILE); 234 236 log_msg(1, "res=%d; tmp='%s'", res, tmp); 235 237 if (bkpinfo->use_star && (res == 254 || res == 65024) … … 390 392 } 391 393 392 if (g_tmpfs_mountpt [0] != '\0') {394 if (g_tmpfs_mountpt != NULL) { 393 395 tmp = call_program_and_get_last_line_of_output 394 396 ("df -m -P | grep dev/shm | grep -v none | tr -s ' ' '\t' | cut -f4"); … … 424 426 * @ingroup archiveGroup 425 427 */ 426 int backup_data(struct s_bkpinfo *bkpinfo , struct s_mrconf *mrconf)428 int backup_data(struct s_bkpinfo *bkpinfo) 427 429 { 428 430 int retval = 0, res = 0; … … 651 653 else 652 654 ch = 'U'; 655 653 656 if (bkpinfo->boot_loader != '\0') { 654 657 asprintf(&tmp, "User specified boot loader. It is '%c'.", … … 743 746 } 744 747 paranoid_free(tmp); 748 /* BERLIOS: Use bkptype_to_string without LANG */ 745 749 switch (bkpinfo->backup_media_type) { 746 750 case cdr: … … 1106 1110 * @ingroup MLarchiveGroup 1107 1111 */ 1108 int do_that_final_phase(struct s_bkpinfo *bkpinfo , struct s_mrconf *mrconf)1112 int do_that_final_phase(struct s_bkpinfo *bkpinfo) 1109 1113 { 1110 1114 … … 1125 1129 } else { 1126 1130 /* write final ISO */ 1127 res = write_final_iso_if_necessary(bkpinfo , mrconf);1131 res = write_final_iso_if_necessary(bkpinfo); 1128 1132 retval += res; 1129 1133 if (res) { … … 1178 1182 g_serial_string = call_program_and_get_last_line_of_output("dd \ 1179 1183 if=/dev/urandom bs=16 count=1 2> /dev/null | \ 1180 hexdump | tr -s ' ' '0' | head -n1") );1184 hexdump | tr -s ' ' '0' | head -n1"); 1181 1185 asprintf(&tmp, "%s...word.", g_serial_string); 1182 1186 paranoid_free(g_serial_string); … … 1269 1273 } 1270 1274 /* if not Debian then go ahead & use fdformat */ 1271 tempfile = call_program_and_get_last_line_of_output("mktemp -q /tmp/mondo.XXXXXXXX") );1275 tempfile = call_program_and_get_last_line_of_output("mktemp -q /tmp/mondo.XXXXXXXX"); 1272 1276 asprintf(&command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, 1273 1277 tempfile, tempfile); … … 1294 1298 if (trackno <= 5 && last_trkno > 40) { 1295 1299 close_evalcall_form(); 1296 strcpy(title, "Verifying format"); 1297 open_evalcall_form(title); 1300 open_evalcall_form("Verifying format"); 1298 1301 } 1299 1302 last_trkno = trackno; … … 1401 1404 * @return The number of errors encountered (0 for success) 1402 1405 */ 1403 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo , struct s_mrconf *mrconf)1406 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo) 1404 1407 { 1405 1408 … … 1544 1547 } else { 1545 1548 res = 1546 move_files_to_cd(bkpinfo, mrconf,storing_filelist_fname,1549 move_files_to_cd(bkpinfo, storing_filelist_fname, 1547 1550 curr_xattr_list_fname, 1548 1551 curr_acl_list_fname, … … 1624 1627 * @return The number of errors encountered (0 for success) 1625 1628 */ 1626 int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,char *destfile)1629 int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile) 1627 1630 { 1628 1631 /*@ int ********************************************** */ … … 1667 1670 /* BERLIOS: Do not ignore getcwd result */ 1668 1671 (void) getcwd(old_pwd, MAX_STR_LEN - 1); 1669 asprintf(&tmp, "chmod 7 44%s", bkpinfo->scratchdir);1672 asprintf(&tmp, "chmod 755 %s", bkpinfo->scratchdir); 1670 1673 run_program_and_log_output(tmp, FALSE); 1671 1674 paranoid_free(tmp); 1672 1675 chdir(bkpinfo->scratchdir); 1673 1676 1674 if (bkpinfo->call_before_iso [0] != '\0') {1677 if (bkpinfo->call_before_iso != NULL) { 1675 1678 asprintf(&message_to_screen, "Running pre-ISO call for CD#%d", 1676 1679 g_current_media_number); … … 1687 1690 } 1688 1691 1689 if (bkpinfo->call_make_iso [0] != '\0') {1692 if (bkpinfo->call_make_iso != NULL) { 1690 1693 log_msg(2, "bkpinfo->call_make_iso = %s", bkpinfo->call_make_iso); 1691 1694 asprintf(&tmp, "%s/archives/NOT-THE-LAST", bkpinfo->scratchdir); 1692 1695 asprintf(&message_to_screen, "Making an ISO (%s #%d)", 1693 media_descriptor_string(bkpinfo->backup_media_type),1696 bkpinfo->backup_media_string, 1694 1697 g_current_media_number); 1695 1698 … … 1789 1792 } else { 1790 1793 asprintf(&message_to_screen, "Running mkisofs to make %s #%d", 1791 media_descriptor_string(bkpinfo->backup_media_type),1794 bkpinfo->backup_media_string, 1792 1795 g_current_media_number); 1793 1796 log_msg(1, message_to_screen); 1794 1797 asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ", 1795 media_descriptor_string(bkpinfo->backup_media_type),1798 bkpinfo->backup_media_string, 1796 1799 g_current_media_number); 1797 1800 if (bkpinfo->nonbootable_backup) { … … 1818 1821 #ifdef __IA64__ 1819 1822 log_msg(1, "IA64 --> elilo"); 1820 asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", mrconf->ia64_boot_size);1823 asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", bkpinfo->mrconf->mindi_ia64_boot_size); 1821 1824 res = eval_call_to_make_ISO(bkpinfo, 1822 1825 tmp2, … … 1870 1873 } 1871 1874 1872 if (bkpinfo->call_burn_iso [0] != '\0') {1875 if (bkpinfo->call_burn_iso != NULL) { 1873 1876 log_msg(2, "bkpinfo->call_burn_iso = %s", bkpinfo->call_burn_iso); 1874 1877 asprintf(&message_to_screen, "Burning %s #%d", 1875 media_descriptor_string(bkpinfo->backup_media_type),1878 bkpinfo->backup_media_string, 1876 1879 g_current_media_number); 1877 1880 pause_and_ask_for_cdr(2, &cd_is_mountable); … … 1888 1891 } 1889 1892 1890 if (bkpinfo->call_after_iso [0] != '\0') {1893 if (bkpinfo->call_after_iso != NULL) { 1891 1894 asprintf(&message_to_screen, "Running post-ISO call (%s #%d)", 1892 media_descriptor_string(bkpinfo->backup_media_type),1895 bkpinfo->backup_media_string, 1893 1896 g_current_media_number); 1894 1897 res = eval_call_to_make_ISO(bkpinfo, bkpinfo->call_after_iso, … … 1922 1925 bigfile_fname); 1923 1926 log_msg(1, "command = '%s'", command); 1924 tmp = call_program_and_get_last_line_of_output(command) );1927 tmp = call_program_and_get_last_line_of_output(command); 1925 1928 log_msg(1, "--> tmp = '%s'", tmp); 1926 1929 paranoid_free(command); … … 1951 1954 */ 1952 1955 int 1953 make_slices_and_images(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,char *biggielist_fname)1956 make_slices_and_images(struct s_bkpinfo *bkpinfo, char *biggielist_fname) 1954 1957 { 1955 1958 … … 2070 2073 } 2071 2074 res = 2072 slice_up_file_etc(bkpinfo, mrconf,bigfile_fname,2075 slice_up_file_etc(bkpinfo, bigfile_fname, 2073 2076 ntfsprog_fifo, biggie_file_number, 2074 2077 noof_biggie_files, use_ntfsprog); … … 2119 2122 * @see make_afioballs_and_images 2120 2123 */ 2121 int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo , struct s_mrconf *mrconf)2124 int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo) 2122 2125 { 2123 2126 … … 2193 2196 } else { 2194 2197 res = 2195 move_files_to_cd(bkpinfo, mrconf,curr_filelist_fname,2198 move_files_to_cd(bkpinfo, curr_filelist_fname, 2196 2199 curr_xattr_list_fname, 2197 2200 curr_acl_list_fname, curr_afioball_fname, … … 2241 2244 * @ingroup MLarchiveGroup 2242 2245 */ 2243 int make_those_afios_phase(struct s_bkpinfo *bkpinfo , struct s_mrconf *mrconf)2246 int make_those_afios_phase(struct s_bkpinfo *bkpinfo) 2244 2247 { 2245 2248 /*@ int ******************************************* */ … … 2258 2261 log_msg(1, 2259 2262 "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0"); 2260 res = make_afioballs_and_images_OLD(bkpinfo , mrconf);2263 res = make_afioballs_and_images_OLD(bkpinfo); 2261 2264 #else 2262 res = make_afioballs_and_images_OLD(bkpinfo , mrconf);2265 res = make_afioballs_and_images_OLD(bkpinfo); 2263 2266 #endif 2264 2267 write_header_block_to_stream((off_t)0, "stop-afioballs", 2265 2268 BLK_STOP_AFIOBALLS); 2266 2269 } else { 2267 res = make_afioballs_and_images(bkpinfo , mrconf);2270 res = make_afioballs_and_images(bkpinfo); 2268 2271 } 2269 2272 … … 2371 2374 * transfer files over the network) or leave it as is. 2372 2375 */ 2373 int (*move_files_to_cd) (struct s_bkpinfo *, struct s_mrconf *mrconf,char *, ...) =2376 int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...) = 2374 2377 _move_files_to_cd; 2375 2378 … … 2392 2395 * @return The number of errors encountered (0 for success) 2393 2396 */ 2394 int _move_files_to_cd(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,char *files_to_add, ...)2397 int _move_files_to_cd(struct s_bkpinfo *bkpinfo, char *files_to_add, ...) 2395 2398 { 2396 2399 … … 2431 2434 if (would_occupy / 1024 > bkpinfo->media_size[g_current_media_number]) { 2432 2435 /* FALSE because this is not the last CD we'll write */ 2433 res = write_iso_and_go_on(bkpinfo, mrconf,FALSE);2436 res = write_iso_and_go_on(bkpinfo, FALSE); 2434 2437 retval += res; 2435 2438 if (res) { … … 2823 2826 2824 2827 asprintf(&szmsg, "I am about to burn %s #%d", 2825 media_descriptor_string(g_backup_media_type),2828 g_backup_media_string, 2826 2829 g_current_media_number); 2827 2830 log_to_screen(szmsg); … … 2860 2863 log_to_screen 2861 2864 ("%s has data on it but it's probably not a Mondo CD.", 2862 media_descriptor_string(g_backup_media_type));2865 g_backup_media_string); 2863 2866 asprintf(&our_serial_str, "%s", ""); 2864 2867 } else { 2865 2868 log_to_screen("%s found in drive. It's a Mondo disk.", 2866 media_descriptor_string(g_backup_media_type));2869 g_backup_media_string); 2867 2870 tmp1 = last_line_of_file(szcdno); 2868 2871 cd_number = atoi(tmp1); … … 2885 2888 if (cd_number > 0 && !strcmp(our_serial_str, g_serial_string)) { 2886 2889 log_msg(2, "This %s is part of this backup set!", 2887 media_descriptor_string(g_backup_media_type));2890 g_backup_media_string); 2888 2891 ok_go_ahead_burn_it = FALSE; 2889 2892 if (cd_number == g_current_media_number - 1) { 2890 2893 log_to_screen 2891 2894 ("I think you've left the previous %s in the drive.", 2892 media_descriptor_string(g_backup_media_type));2895 g_backup_media_string); 2893 2896 } else { 2894 2897 log_to_screen 2895 2898 ("Please remove this %s. It is part of the backup set you're making now.", 2896 media_descriptor_string(g_backup_media_type));2899 g_backup_media_string); 2897 2900 } 2898 2901 } else { … … 2903 2906 log_msg(2, 2904 2907 "paafcd: Can't find CD-ROM drive. Perhaps it has a blank %s in it?", 2905 media_descriptor_string(g_backup_media_type));2908 g_backup_media_string); 2906 2909 if ((cdrw_device = interrogate_disk_currently_in_cdrw_drive(cdrw_device)) != NULL) { 2907 2910 ok_go_ahead_burn_it = FALSE; 2908 2911 log_to_screen("There isn't a writable %s in the drive.", 2909 media_descriptor_string(g_backup_media_type));2912 g_backup_media_string); 2910 2913 } 2911 2914 paranoid_free(cdrw_device); … … 2917 2920 asprintf(&tmp, 2918 2921 "I am about to burn %s #%d of the backup set. Please insert %s and press Enter.", 2919 media_descriptor_string(g_backup_media_type),2922 g_backup_media_string, 2920 2923 g_current_media_number, 2921 media_descriptor_string(g_backup_media_type));2924 g_backup_media_string); 2922 2925 popup_and_OK(tmp); 2923 2926 paranoid_free(tmp); … … 2930 2933 log_msg(2, 2931 2934 "paafcd: OK, I assume I have a blank/reusable %s in the drive...", 2932 media_descriptor_string(g_backup_media_type));2935 g_backup_media_string); 2933 2936 2934 2937 log_to_screen("Proceeding w/ %s in drive.", 2935 media_descriptor_string(g_backup_media_type));2938 g_backup_media_string); 2936 2939 if (pmountable) { 2937 2940 if (attempt_to_mount_returned_this) { … … 2994 2997 */ 2995 2998 int 2996 slice_up_file_etc(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,char *biggie_filename,2999 slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename, 2997 3000 char *ntfsprog_fifo, long biggie_file_number, 2998 3001 long noof_biggie_files, bool use_ntfsprog) … … 3092 3095 } 3093 3096 lstat(biggie_filename, &biggiestruct.properties); 3094 strcpy(biggiestruct.filename, biggie_filename); 3097 if (strlen(checksum_line) <= MAX_STR_LEN) { 3098 strcpy(biggiestruct.filename, biggie_filename); 3099 } else { 3100 fatal_error("biggie_filename too big"); 3101 } 3095 3102 pB = strchr(checksum_line, ' '); 3096 3103 if (!pB) { … … 3100 3107 *pB = '\0'; 3101 3108 } 3102 strcpy(biggiestruct.checksum, checksum_line); 3109 if (strlen(checksum_line) <= 64) { 3110 strcpy(biggiestruct.checksum, checksum_line); 3111 } else { 3112 fatal_error("checksum_line too big"); 3113 } 3103 3114 paranoid_free(checksum_line); 3104 3115 … … 3125 3136 res = move_files_to_stream(bkpinfo,tmp,NULL); 3126 3137 } else { 3127 res = move_files_to_cd(bkpinfo, mrconf,tmp, NULL);3138 res = move_files_to_cd(bkpinfo, tmp, NULL); 3128 3139 } 3129 3140 paranoid_free(tmp); … … 3131 3142 for (slice_num = 1; !finished; slice_num++) { 3132 3143 curr_slice_fname_uncompressed = slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, ""); 3133 curr_slice_fname_compressed = slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, suffix) );3144 curr_slice_fname_compressed = slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, suffix); 3134 3145 3135 3146 tmp = percent_media_full_comment(bkpinfo); … … 3236 3247 res = move_files_to_stream(bkpinfo, file_to_archive, NULL); 3237 3248 } else { 3238 res = move_files_to_cd(bkpinfo, mrconf,file_to_archive, NULL);3249 res = move_files_to_cd(bkpinfo, file_to_archive, NULL); 3239 3250 } 3240 3251 paranoid_free(file_to_archive); … … 3332 3343 * however, this occurs rarely. 3333 3344 */ 3334 int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo , struct s_mrconf *mrconf)3345 int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo) 3335 3346 { 3336 3347 /*@ int ***************************************************** */ … … 3355 3366 #endif 3356 3367 paranoid_free(tmp); 3357 res = write_iso_and_go_on(bkpinfo, mrconf,TRUE);3368 res = write_iso_and_go_on(bkpinfo, TRUE); 3358 3369 #ifndef _XWIN 3359 3370 if (!g_text_mode) { … … 3383 3394 * @see make_iso_fs 3384 3395 */ 3385 int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,bool last_cd)3396 int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, bool last_cd) 3386 3397 { 3387 3398 /*@ pointers **************************************************** */ … … 3414 3425 } 3415 3426 log_msg(1, "OK, time to make %s #%d", 3416 media_descriptor_string(bkpinfo->backup_media_type),3427 bkpinfo->backup_media_string, 3417 3428 g_current_media_number); 3418 3429 … … 3461 3472 g_current_media_number); 3462 3473 for (that_one_was_ok = FALSE; !that_one_was_ok;) { 3463 res = make_iso_fs(bkpinfo, mrconf,isofile);3474 res = make_iso_fs(bkpinfo, isofile); 3464 3475 if (g_current_media_number == 1 && !res 3465 3476 && (bkpinfo->backup_media_type == cdr … … 3478 3489 log_to_screen 3479 3490 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", 3480 media_descriptor_string(g_backup_media_type));3491 g_backup_media_string); 3481 3492 chdir("/"); 3482 3493 iamhere("Before calling verify_cd_image()"); … … 3488 3499 } else { 3489 3500 asprintf(&tmp, "Failed to burn %s #%d. Retry?", 3490 media_descriptor_string(bkpinfo->backup_media_type),3501 bkpinfo->backup_media_string, 3491 3502 g_current_media_number); 3492 3503 res = ask_me_yes_or_no(tmp); … … 3577 3588 g_current_media_number = cdno; 3578 3589 if (bkpinfo->backup_media_type != iso) { 3579 bkpinfo->media_device = find_cdrom_device(FALSE) );3590 bkpinfo->media_device = find_cdrom_device(FALSE); 3580 3591 } 3581 3592 chdir("/"); … … 3595 3606 asprintf(&tmp, 3596 3607 "Warnings/errors were reported while checking %s #%d", 3597 media_descriptor_string(bkpinfo-> 3598 backup_media_type), 3608 bkpinfo->backup_media_string, 3599 3609 g_current_media_number); 3600 3610 log_to_screen(tmp); … … 3745 3755 } 3746 3756 3747 void mr archive_init_conf(struct s_mrconf *mrconf) {3757 void mr_archive_init_conf(struct s_mr_conf *mr_conf) { 3748 3758 char *command = NULL; 3749 FILE *conffd = NULL;3750 3759 FILE *fin = NULL; 3751 int n = 0;3760 size_t n = 0; 3752 3761 char *param = NULL; 3753 3762 3754 mr conf = (struct s_mrconf *)malloc(sizeof(struct s_mrconf));3755 if (mr conf == NULL) {3756 fatal_error("Unable to malloc mr conf");3763 mr_conf = (struct s_mr_conf *)malloc(sizeof(struct s_mr_conf)); 3764 if (mr_conf == NULL) { 3765 fatal_error("Unable to malloc mr_conf"); 3757 3766 } 3758 3767 /* Default for everything int : 0 char * : NULL */ 3759 3768 3760 3769 /* mindi conf parameters also needed in mondo */ 3761 mr conf->ia64_boot_size = 0;3770 mr_conf->mindi_ia64_boot_size = 0; 3762 3771 3763 3772 asprintf(&command, "mindi -printvar IA64_BOOT_SIZE"); … … 3766 3775 pclose(fin); 3767 3776 paranoid_free(command); 3768 mr conf->ia64_boot_size = atoi(param);3777 mr_conf->mindi_ia64_boot_size = atoi(param); 3769 3778 paranoid_free(param); 3770 3779 3771 mr conf->iso_creation_cmd = NULL;3780 mr_conf->mondo_iso_creation_cmd = NULL; 3772 3781 3773 3782 /* Finds mondo conf file */ 3774 mr conf_open(MONDO_CONF_DIR"/mondo.conf");3783 mr_conf_open(MONDO_CONF_DIR"/mondo.conf"); 3775 3784 3776 3785 /* mondo conf parameters needed */ 3777 mrconf->iso_creation_cmd = mrconf_sread(iso_creation_cmd); 3778 3779 mrconf_close(); 3786 mr_conf->mondo_iso_creation_cmd = mr_conf_sread("mondo_iso_creation_cmd"); 3787 3788 mr_conf_close(); 3789 } -
trunk/mondo/mondo/common/libmondo-archive.h
r539 r783 17 17 int make_slices_and_images(struct s_bkpinfo *bkpinfo, 18 18 char *biggielist_fname); 19 int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf,char *destfile);19 int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile); 20 20 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo); 21 21 extern int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...); -
trunk/mondo/mondo/common/libmondo-devices-EXT.h
r171 r783 33 33 *, bool); 34 34 35 36 extern void make_fifo(char *store_name_here, char *stub);37 38 39 35 extern void insist_on_this_cd_number(struct s_bkpinfo *bkpinfo, 40 36 int cd_number_i_want); … … 69 65 70 66 extern char *which_partition_format(const char *drive); 67 extern char *bkptype_to_string(t_bkptype bt); -
trunk/mondo/mondo/common/libmondo-devices.c
r729 r783 63 63 if (bkpinfo->media_device != NULL) { 64 64 paranoid_alloc(g_cdrom_drive_is_here, bkpinfo->media_device); // just in case 65 }66 if (bkpinfo->media_device != NULL) {67 65 paranoid_alloc(g_dvd_drive_is_here, bkpinfo->media_device); // just in case 68 66 } … … 95 93 log_it("rctada: Unmounting all CD drives", __LINE__); 96 94 run_program_and_log_output("umount /dev/cdr* /dev/dvd*", 5); 95 } 96 97 98 /** 99 * Mount the CD-ROM at @p mountpoint. 100 * @param device The device (or file if g_ISO_restore_mode) to mount. 101 * @param mountpoint The place to mount it. 102 * @return TRUE for success, FALSE for failure. 103 */ 104 bool mount_CDROM_here(char *device, char *mountpoint) 105 { 106 /*@ buffer ****************************************************** */ 107 char *command = NULL; 108 int retval = 0; 109 110 assert_string_is_neither_NULL_nor_zerolength(device); 111 assert_string_is_neither_NULL_nor_zerolength(mountpoint); 112 113 make_hole_for_dir(mountpoint); 114 if (isdigit(device[0])) { 115 paranoid_free(device); 116 device = find_cdrom_device(FALSE); 117 } 118 if (g_ISO_restore_mode) { 119 120 #ifdef __FreeBSD__ 121 char *dev = NULL; 122 123 dev = make_vn(device)); 124 if (!dev) { 125 asprintf(&command, "Unable to mount ISO (make_vn(%s) failed)", 126 device); 127 fatal_error(command); 128 } 129 paranoid_free(device); 130 device = dev; 131 #endif 132 } 133 134 log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device, 135 mountpoint); 136 /*@ end vars *************************************************** */ 137 138 #ifdef __FreeBSD__ 139 asprintf(&command, "mount_cd9660 -r %s %s 2>> %s", 140 device, mountpoint, MONDO_LOGFILE); 141 #else 142 asprintf(&command, "mount %s -o ro,loop -t iso9660 %s 2>> %s", 143 device, mountpoint, MONDO_LOGFILE); 144 #endif 145 146 log_msg(4, command); 147 if (strncmp(device, "/dev/", 5) == 0) { 148 retract_CD_tray_and_defeat_autorun(); 149 } 150 retval = system(command); 151 log_msg(1, "system(%s) returned %d", command, retval); 152 paranoid_free(command); 153 154 if (retval == 0) { 155 return(TRUE); 156 } else { 157 return(FALSE); 158 } 97 159 } 98 160 … … 1232 1294 1233 1295 /** 1234 * Mount the CD-ROM at @p mountpoint.1235 * @param device The device (or file if g_ISO_restore_mode) to mount.1236 * @param mountpoint The place to mount it.1237 * @return TRUE for success, FALSE for failure.1238 */1239 bool mount_CDROM_here(char *device, char *mountpoint)1240 {1241 /*@ buffer ****************************************************** */1242 char *command = NULL;1243 int retval = 0;1244 1245 assert_string_is_neither_NULL_nor_zerolength(device);1246 assert_string_is_neither_NULL_nor_zerolength(mountpoint);1247 1248 make_hole_for_dir(mountpoint);1249 if (isdigit(device[0])) {1250 paranoid_free(device);1251 device = find_cdrom_device(FALSE);1252 }1253 if (g_ISO_restore_mode) {1254 1255 #ifdef __FreeBSD__1256 char *dev = NULL;1257 1258 dev = make_vn(device));1259 if (!dev) {1260 asprintf(&command, "Unable to mount ISO (make_vn(%s) failed)",1261 device);1262 fatal_error(command);1263 }1264 paranoid_free(device);1265 device = dev;1266 #endif1267 }1268 1269 log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device,1270 mountpoint);1271 /*@ end vars *************************************************** */1272 1273 #ifdef __FreeBSD__1274 asprintf(&command, "mount_cd9660 -r %s %s 2>> %s",1275 device, mountpoint, MONDO_LOGFILE);1276 #else1277 asprintf(&command, "mount %s -o ro,loop -t iso9660 %s 2>> %s",1278 device, mountpoint, MONDO_LOGFILE);1279 #endif1280 1281 log_msg(4, command);1282 if (strncmp(device, "/dev/", 5) == 0) {1283 retract_CD_tray_and_defeat_autorun();1284 }1285 retval = system(command);1286 log_msg(1, "system(%s) returned %d", command, retval);1287 paranoid_free(command);1288 1289 if (retval == 0) {1290 return(TRUE);1291 } else {1292 return(FALSE);1293 }1294 }1295 1296 1297 /**1298 1296 * Ask the user for CD number @p cd_number_i_want. 1299 1297 * Sets g_current_media_number once the correct CD is inserted. … … 1355 1353 "FIXME - hacking bkpinfo->isodir from '%s' to /tmp/isodir", 1356 1354 bkpinfo->isodir); 1357 strcpy(bkpinfo->isodir, "/tmp/isodir");1355 paranoid_alloc(bkpinfo->isodir, "/tmp/isodir"); 1358 1356 } 1359 1357 } … … 1368 1366 cd_number_i_want); 1369 1367 asprintf(&tmp, "Insisting on %s #%d", 1370 media_descriptor_string(bkpinfo->backup_media_type),1368 bkpinfo->backup_media_string, 1371 1369 cd_number_i_want); 1372 1370 asprintf(&request, "Please insert %s #%d and press Enter.", 1373 media_descriptor_string(bkpinfo->backup_media_type),1371 bkpinfo->backup_media_string, 1374 1372 cd_number_i_want); 1375 1373 log_msg(3, tmp); … … 1451 1449 popup_and_OK(_("Please remove CD/floppy from drive(s)")); 1452 1450 } 1453 log_msg(3, "media type = %s", 1454 bkptype_to_string(bkpinfo->backup_media_type)); 1451 bkpinfo->backup_media_string = bkptype_to_string(bkpinfo->backup_media_type); 1452 log_msg(3, "media type = %s",bkpinfo->backup_media_string); 1453 1455 1454 if (archiving_to_media) { 1456 1455 sensibly_set_tmpdir_and_scratchdir(bkpinfo); … … 1496 1495 } 1497 1496 asprintf(&comment, _("What speed is your %s (re)writer?"), 1498 media_descriptor_string(bkpinfo->backup_media_type));1497 bkpinfo->backup_media_string); 1499 1498 if (bkpinfo->backup_media_type == dvd) { 1499 paranoid_free(bkpinfo->media_device); 1500 1500 bkpinfo->media_device = find_dvd_device(); 1501 1501 asprintf(&tmp, "1"); … … 1521 1521 asprintf(&comment, 1522 1522 _("How much data (in Megabytes) will each %s store?"), 1523 media_descriptor_string(bkpinfo->backup_media_type));1523 bkpinfo->backup_media_string); 1524 1524 1525 1525 if (!popup_and_get_string("Size", comment, sz_size)) { … … 1551 1551 log_msg(1, "bkpinfo->media_device = %s", 1552 1552 bkpinfo->media_device); 1553 tmp = find_cdrom_device(FALSE); 1553 1554 if ((bkpinfo->backup_media_type == dvd) 1554 || ((tmp = find_cdrom_device(FALSE)) != NULL)) { 1555 paranoid_free(bkpinfo->media_device); 1556 bkpinfo->media_device = tmp; 1555 || (tmp != NULL)) { 1556 paranoid_alloc(bkpinfo->media_device, tmp); 1557 1557 log_msg(1, "bkpinfo->media_device = %s", 1558 1558 bkpinfo->media_device); 1559 1559 asprintf(&comment, 1560 1560 _("Please specify your %s drive's /dev entry"), 1561 media_descriptor_string(bkpinfo-> 1562 backup_media_type)); 1561 bkpinfo->backup_media_string); 1563 1562 if (!popup_and_get_string 1564 1563 (_("Device?"), comment, bkpinfo->media_device)) { … … 1568 1567 paranoid_free(comment); 1569 1568 } 1569 paranoid_free(tmp); 1570 1570 1571 log_msg(2, "%s device found at %s", 1571 media_descriptor_string(bkpinfo->backup_media_type),1572 bkpinfo->backup_media_string, 1572 1573 bkpinfo->media_device); 1573 1574 } else { … … 1576 1577 asprintf(&tmp, 1577 1578 _("I think I've found your %s burner at SCSI node %s; am I right on the money? Say no if you have an IDE burner and you are running a 2.6 kernel. Instead, specify the IDE burner's /dev address at the next screen."), 1578 media_descriptor_string(bkpinfo-> 1579 backup_media_type), 1579 bkpinfo->backup_media_string, 1580 1580 bkpinfo->media_device); 1581 1581 if (!ask_me_yes_or_no(tmp)) { … … 1628 1628 } else { 1629 1629 if (does_file_exist("/tmp/mondo-restore.cfg")) { 1630 paranoid_free(bkpinfo->media_device); 1630 1631 read_cfg_var("/tmp/mondo-restore.cfg", "media-dev", 1631 1632 bkpinfo->media_device); … … 1639 1640 } 1640 1641 paranoid_free(tmp); 1641 } 1642 if (bkpinfo->media_device == NULL) { 1642 } else { 1643 1643 if (!popup_and_get_string 1644 1644 (_("Device name?"), … … 1677 1677 1678 1678 case nfs: 1679 if (!bkpinfo->nfs_mount[0]) { 1680 strcpy(bkpinfo->nfs_mount, 1681 call_program_and_get_last_line_of_output 1682 ("mount | grep \":\" | cut -d' ' -f1 | head -n1")); 1679 if (bkpinfo->nfs_mount == NULL) { 1680 bkpinfo->nfs_mount = call_program_and_get_last_line_of_output 1681 ("mount | grep \":\" | cut -d' ' -f1 | head -n1"); 1683 1682 } 1684 1683 #ifdef __FreeBSD__ … … 1704 1703 // check whether already mounted - we better remove 1705 1704 // surrounding spaces and trailing '/' for this 1705 /* BERLIOS: Useless 1706 1706 strip_spaces(bkpinfo->nfs_mount); 1707 */ 1707 1708 if (bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/') 1708 1709 bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] = '\0'; 1709 1710 asprintf(&command, "mount | grep \"%s \" | cut -d' ' -f3", 1710 1711 bkpinfo->nfs_mount); 1711 strcpy(bkpinfo->isodir,1712 call_program_and_get_last_line_of_output(command));1712 paranoid_free(bkpinfo->isodir); 1713 bkpinfo->isodir = call_program_and_get_last_line_of_output(command); 1713 1714 paranoid_free(command); 1714 1715 … … 1738 1739 } 1739 1740 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { 1740 sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d", 1741 paranoid_free(bkpinfo->isodir); 1742 asprintf(&bkpinfo->isodir, "/tmp/isodir.mondo.%d", 1741 1743 (int) (random() % 32768)); 1742 1744 asprintf(&command, "mkdir -p %s", bkpinfo->isodir); … … 1748 1750 run_program_and_log_output(tmp, 5); 1749 1751 paranoid_free(tmp); 1750 malloc_string(g_selfmounted_isodir); 1751 strcpy(g_selfmounted_isodir, bkpinfo->isodir); 1752 asprintf(&g_selfmounted_isodir, bkpinfo->isodir); 1752 1753 } 1753 1754 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { … … 1845 1846 if (archiving_to_media) { 1846 1847 1848 if (bkpinfo->boot_device) { 1849 paranoid_free(bkpinfo->boot_device); 1850 } 1847 1851 #ifdef __FreeBSD__ 1848 1852 bkpinfo->boot_device = call_program_and_get_last_line_of_output 1849 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'") );1853 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'"); 1850 1854 #else 1851 1855 bkpinfo->boot_device = call_program_and_get_last_line_of_output 1852 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'") );1856 ("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'"); 1853 1857 #endif 1854 1858 i = which_boot_loader(bkpinfo->boot_device); … … 1989 1993 log_it("media device = %s", bkpinfo->media_device); 1990 1994 log_it("media size = %ld", bkpinfo->media_size[1]); 1991 log_it("media type = %s", 1992 bkptype_to_string(bkpinfo->backup_media_type));1995 log_it("media type = %s", bkpinfo->backup_media_string); 1996 paranoid_free(tmp); 1993 1997 log_it("prefix = %s", bkpinfo->prefix); 1994 1998 log_it("compression = %ld", bkpinfo->compression_level); … … 1999 2003 log_it("boot_device = '%s' (loader=%c)", bkpinfo->boot_device, 2000 2004 bkpinfo->boot_loader); 2001 log_it("prefix = %s", bkpinfo->prefix);2002 2005 if (bkpinfo->media_size[0] < 0) { 2003 2006 if (archiving_to_media) { … … 2033 2036 2034 2037 /** 2035 * Create a randomly-named FIFO. The format is @p stub "." [random] [random] where2036 * [random] is a random number between 1 and 32767.2037 * @param store_name_here Where to store the new filename.2038 * @param stub A random number will be appended to this to make the FIFO's name.2039 * @ingroup deviceGroup2040 */2041 void make_fifo(char *store_name_here, char *stub)2042 {2043 char *tmp;2044 2045 assert_string_is_neither_NULL_nor_zerolength(stub);2046 2047 sprintf(store_name_here, "%s%d%d", stub, (int) (random() % 32768),2048 (int) (random() % 32768));2049 make_hole_for_file(store_name_here);2050 mkfifo(store_name_here, S_IRWXU | S_IRWXG);2051 asprintf(&tmp, "chmod 770 %s", store_name_here);2052 paranoid_system(tmp);2053 paranoid_free(tmp);2054 }2055 2056 2057 /**2058 2038 * Set the tmpdir and scratchdir to reside on the partition with the most free space. 2059 2039 * Automatically excludes DOS, NTFS, SMB, and NFS filesystems. … … 2087 2067 } 2088 2068 i = (int) (random() % 32768); 2069 paranoid_free(bkpinfo->tmpdir); 2089 2070 asprintf(&bkpinfo->tmpdir, "%s/mondo.tmp.%d", tmp, i); 2090 2071 log_it("bkpinfo->tmpdir is being set to %s", bkpinfo->tmpdir); 2091 2072 2073 paranoid_free(bkpinfo->scratchdir); 2092 2074 asprintf(&bkpinfo->scratchdir, "%s/mondo.scratch.%d", tmp, i); 2093 2075 log_it("bkpinfo->scratchdir is being set to %s", bkpinfo->scratchdir); … … 2277 2259 2278 2260 char which_boot_loader(char *which_device) 2261 /* which_device is allocated here and needs to be freed by caller */ 2279 2262 { 2280 2263 /*@ buffer ***************************************************** */ … … 2315 2298 if (does_string_exist_in_boot_block(current_drive, "GRUB")) { 2316 2299 count_grubs++; 2317 strcpy(which_device,current_drive);2300 paranoid_alloc(which_device,current_drive); 2318 2301 break; 2319 2302 } 2320 2303 if (does_string_exist_in_boot_block(current_drive, "LILO")) { 2321 2304 count_lilos++; 2322 strcpy(which_device,current_drive);2305 paranoid_alloc(which_device,current_drive); 2323 2306 break; 2324 2307 } 2325 2308 } 2326 paranoid_free(current_drive);2327 2309 2328 2310 if (pclose(pdrives)) { -
trunk/mondo/mondo/common/libmondo-devices.h
r171 r783 7 7 int does_partition_exist(const char *drive, int partno); 8 8 bool does_string_exist_in_boot_block(char *dev, char *str); 9 intfind_and_mount_actual_cd(struct s_bkpinfo *bkpinfo, char *mountpoint);9 bool find_and_mount_actual_cd(struct s_bkpinfo *bkpinfo, char *mountpoint); 10 10 char *find_cdrom_device(bool try_to_mount); 11 11 char *find_dvd_device(void); … … 28 28 29 29 30 31 void make_fifo(char *store_name_here, char *stub);32 30 33 31 void insist_on_this_cd_number(struct s_bkpinfo *bkpinfo, … … 58 56 59 57 char *which_partition_format(const char *drive); 58 char *bkptype_to_string(t_bkptype bt); -
trunk/mondo/mondo/common/libmondo-filelist.c
r729 r783 266 266 i = 0; 267 267 } 268 /* BERLIOS: Useless with getline269 if (i > MAX_STR_LEN - 1) {270 incoming[MAX_STR_LEN - 30] = '\0';271 log_msg(1, "Warning - truncating file %s's name", incoming);272 err++;273 }274 */275 268 if (incoming[i] < 32) { 276 269 incoming[i] = '\0'; … … 717 710 { 718 711 /*@ buffers ***************************************************** */ 719 char val_sz[MAX_STR_LEN];720 char *cfg_fname ;712 char *val_sz = NULL; 713 char *cfg_fname = NULL; 721 714 722 715 /*@ long ******************************************************** */ 723 int val_i ;716 int val_i = 0; 724 717 725 718 /*@ end vars **************************************************** */ … … 730 723 read_cfg_var(cfg_fname, "last-filelist-number", val_sz); 731 724 val_i = atoi(val_sz); 725 paranoid_free(val_sz); 726 732 727 if (val_i <= 0) { 733 728 val_i = 500; … … 1356 1351 asprintf(&tmp, 1357 1352 "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null", 1358 dir, MAX_SKEL_DEPTH, g_skeleton_filelist);1353 dir, MAX_SKEL_DEPTH, skeleton_filelist); 1359 1354 #else 1360 1355 // On BSD, for example, /sys is the kernel sources -- don't exclude 1361 1356 asprintf(&tmp, 1362 1357 "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o -type d -a -print > %s 2> /dev/null", 1363 dir, MAX_SKEL_DEPTH, g_skeleton_filelist);1358 dir, MAX_SKEL_DEPTH, skeleton_filelist); 1364 1359 #endif 1365 1360 system(tmp); … … 1435 1430 /* BERLIOS: Old code 1436 1431 new_with_spaces[0] = ' '; 1437 str cpy(new_with_spaces + 1, new);1438 str cat(new_with_spaces, " ");1432 str-cpy(new_with_spaces + 1, new); 1433 str-cat(new_with_spaces, " "); 1439 1434 */ 1440 1435 if (strstr(skip_these, new_with_spaces)) { … … 1504 1499 { 1505 1500 static char sz_res[MAX_STR_LEN]; 1506 char *p ;1501 char *p = NULL; 1507 1502 bool in_quotes = FALSE; 1508 1503 -
trunk/mondo/mondo/common/libmondo-files-EXT.h
r687 r783 7 7 extern unsigned int updcrcr(unsigned int crc, unsigned int c); 8 8 extern char *calc_checksum_of_file(char *filename); 9 extern char *calc_file_ugly_minichecksum(char *curr_fname);10 9 extern long count_lines_in_file(char *filename); 11 10 extern bool does_file_exist(char *filename); -
trunk/mondo/mondo/common/libmondo-files.c
r764 r783 25 25 26 26 extern int g_currentY; 27 extern int g_noof_log_lines; 27 28 extern char *g_mondo_home; 28 29 … … 77 78 } 78 79 return (output); 79 }80 81 82 /**83 * Get a not-quite-unique representation of some of the file's @c stat properties.84 * The returned string has the form <tt>size-mtime-ctime</tt>.85 * @param curr_fname The file to generate the "checksum" for.86 * @return The "checksum".87 * @note The returned string points to static storage that will be overwritten with each call.88 */89 char *calc_file_ugly_minichecksum(char *curr_fname)90 {91 92 /*@ buffers ***************************************************** */93 char *curr_cksum;94 95 /*@ pointers **************************************************** */96 97 /*@ structures ************************************************** */98 struct stat buf;99 100 /*@************************************************************** */101 102 assert_string_is_neither_NULL_nor_zerolength(curr_fname);103 if (lstat(curr_fname, &buf)) {104 asprintf(&curr_cksum, "");105 } else {106 asprintf(&curr_cksum, "%ld-%ld-%ld", (long) (buf.st_size),107 (long) (buf.st_mtime), (long) (buf.st_ctime));108 }109 return (curr_cksum);110 80 } 111 81 … … 275 245 if (kernel == NULL) { 276 246 kernel = call_program_and_get_last_line_of_output 277 ("mindi --findkernel 2> /dev/null") );247 ("mindi --findkernel 2> /dev/null"); 278 248 } 279 249 // If we didn't get anything back, check whether mindi raised a fatal error … … 481 451 log_it(tmp); 482 452 paranoid_free(tmp); 483 asprintf(&output, ""); 484 485 return (output); 453 return (NULL); 486 454 } 487 455 asprintf(&command, "tail -n1 %s", filename); … … 1033 1001 paranoid_free(command); 1034 1002 1035 if (bkpinfo->postnuke_tarball [0]) {1003 if (bkpinfo->postnuke_tarball) { 1036 1004 asprintf(&command, "cp -f %s %s/post-nuke.tgz", 1037 1005 bkpinfo->postnuke_tarball, bkpinfo->tmpdir); … … 1187 1155 { 1188 1156 /*@ buffers *************** */ 1189 char *tmp ;1157 char *tmp = NULL; 1190 1158 1191 1159 /*@ long long ************* */ … … 1214 1182 asprintf(&tmp, 1215 1183 _("Your backup will probably occupy a single %s. Maybe two."), 1216 media_descriptor_string(bkpinfo->backup_media_type));1184 bkpinfo->backup_media_string); 1217 1185 } else { 1218 1186 asprintf(&tmp, _("Your backup will occupy approximately %s media."), 1219 1187 number_to_text((int) (scratchLL + 1))); 1220 1188 } 1221 if (!bkpinfo->image_devs [0]&& (scratchLL < 50)) {1189 if (!bkpinfo->image_devs && (scratchLL < 50)) { 1222 1190 log_to_screen(tmp); 1223 1191 } … … 1235 1203 bool is_this_file_compressed(char *filename) 1236 1204 { 1237 char *do_not_compress_these ;1238 char *tmp ;1239 char *p ;1205 char *do_not_compress_these = NULL; 1206 char *tmp = NULL; 1207 char *p = NULL; 1240 1208 1241 1209 asprintf(&tmp, "%s/do-not-compress-these", g_mondo_home); -
trunk/mondo/mondo/common/libmondo-files.h
r687 r783 9 9 unsigned int updcrcr(unsigned int crc, unsigned int c); 10 10 char *calc_checksum_of_file(char *filename); 11 char *calc_file_ugly_minichecksum(char *curr_fname);12 char *calc_file_ugly_minichecksum(char *curr_fname);13 11 long count_lines_in_file(char *filename); 14 12 bool does_file_exist(char *filename); -
trunk/mondo/mondo/common/libmondo-fork.c
r689 r783 11 11 #include "libmondo-tools-EXT.h" 12 12 13 extern char *g_tmpfs_mountpt;14 extern t_bkptype g_backup_media_type;15 13 extern bool g_text_mode; 16 14 pid_t g_buffer_pid = 0; … … 107 105 log_msg(4, "Calling open_evalcall_form() with what_i_am_doing='%s'", 108 106 what_i_am_doing); 109 strcpy(tmp, command);110 107 if (bkpinfo->manual_cd_tray) { 111 p = strstr(tmp, "2>>"); 108 /* Find everything after a 2>> and remove it */ 109 p = strstr(command, "2>>"); 112 110 if (p) { 113 sprintf(p, " "); 114 while (*p == ' ') { 115 p++; 116 } 117 for (; *p != ' '; p++) { 111 for (; *p != ' ' && *p != '\0'; p++) { 118 112 *p = ' '; 119 113 } 120 114 } 121 paranoid_free(command);122 asprintf(&command, tmp);123 115 #ifndef _XWIN 124 116 if (!g_text_mode) { … … 164 156 { 165 157 /*@ buffer ****************************************************** */ 166 char *callstr ;158 char *callstr = NULL; 167 159 char *incoming = NULL; 168 char tmp[MAX_STR_LEN * 2];169 160 170 161 /*@ int ********************************************************* */ 171 int res; 172 int i; 162 int res = 0; 173 163 size_t n = 0; 174 int len;175 164 bool log_if_failure = FALSE; 176 165 bool log_if_success = FALSE; … … 203 192 204 193 205 len = (int) strlen(program);206 for (i = 0; i < 35 - len / 2; i++) {207 tmp[i] = '-';208 }209 tmp[i] = '\0';210 strcat(tmp, " ");211 strcat(tmp, program);212 strcat(tmp, " ");213 for (i = 0; i < 35 - len / 2; i++) {214 strcat(tmp, "-");215 }216 194 res = system(callstr); 217 195 if (((res == 0) && log_if_success) || ((res != 0) && log_if_failure)) { … … 361 339 // if dir=='w' then copy from orig to archived 362 340 // if dir=='r' then copy from archived to orig 363 char *tmp ;364 char *buf ;341 char *tmp = NULL; 342 char *buf = NULL; 365 343 long int bytes_to_be_read, bytes_read_in, bytes_written_out = 366 344 0, bufcap, subsliceno = 0; 367 345 int retval = 0; 368 FILE *fin ;369 FILE *fout ;370 FILE *ftmp ;346 FILE *fin = NULL; 347 FILE *fout = NULL; 348 FILE *ftmp = NULL; 371 349 372 350 log_msg(5, "Opening."); … … 439 417 } 440 418 bytes_written_out += fwrite(buf, 1, bytes_read_in, fout); 441 if (fread(tmp, 1, 64 , fin) != 64) {419 if (fread(tmp, 1, 64L, fin) != 64L) { 442 420 fatal_error("Cannot read post-thingy block"); 443 421 } … … 448 426 log_msg(7, "Subslice #%ld read OK", subsliceno); 449 427 subsliceno++; 450 if (fread(tmp, 1, 64 , fin) != 64) {428 if (fread(tmp, 1, 64L, fin) != 64L) { 451 429 fatal_error("Cannot read introductory block"); 452 430 } … … 458 436 459 437 if (direction == 'w') { 438 paranoid_free(tmp); 460 439 asprintf(&tmp, "%-64s", PIMP_END_SZ); 461 if (fwrite(tmp, 1, 64 , fout) != 64) {440 if (fwrite(tmp, 1, 64L, fout) != 64L) { 462 441 fatal_error("Can't write the final block"); 463 442 } … … 466 445 log_msg(1, "tmpA is %s", tmp); 467 446 if (!strstr(tmp, PIMP_END_SZ)) { 468 if (fread(tmp, 1, 64 , fin) != 64) {447 if (fread(tmp, 1, 64L, fin) != 64L) { 469 448 fatal_error("Can't read the final block"); 470 449 } … … 472 451 if (!strstr(tmp, PIMP_END_SZ)) { 473 452 ftmp = fopen("/tmp/out.leftover", "w"); 474 bytes_read_in = fread(tmp, 1, 64 , fin);453 bytes_read_in = fread(tmp, 1, 64L, fin); 475 454 log_msg(1, "bytes_read_in = %ld", bytes_read_in); 476 455 // if (bytes_read_in!=128+64) { fatal_error("Can't read the terminating block"); } 477 456 fwrite(tmp, 1, bytes_read_in, ftmp); 457 478 458 paranoid_free(tmp); 479 480 459 if (!(tmp = malloc(512))) { 481 460 fatal_error("Failed to malloc() tmp"); 482 461 } 483 462 /* BERLIOS : strange ??? 484 s printf(tmp, "I am here - %llu", ftello(fin));485 log_msg(0, tmp);486 */463 s-printf(tmp, "I am here - %llu", ftello(fin)); 464 log_msg(0, tmp); 465 */ 487 466 fread(tmp, 1, 512, fin); 488 467 log_msg(0, "tmp = '%s'", tmp); … … 571 550 if (pcno <= 5 && last_pcno > 40) { 572 551 close_evalcall_form(); 573 open_evalcall_form("_(Verifying...") );552 open_evalcall_form("_(Verifying..."); 574 553 } 575 554 last_pcno = pcno; -
trunk/mondo/mondo/common/libmondo-mountlist.c
r688 r783 63 63 char *tmp1 = NULL; 64 64 char *device = NULL; 65 char *ndevice = NULL; 65 66 // BERLIOS : useless ? char *mountpoint; 66 67 … … 203 204 npos = 0; 204 205 for (cur_sp_no = 'a'; cur_sp_no <= 'h'; cur_sp_no++) { 205 sprintf(device, "%ss%i%c", device, curr_part_no, cur_sp_no);206 if (find_device_in_mountlist(mountlist, device) >= 0)206 asprintf(&ndevice, "%ss%d%c", device, curr_part_no, cur_sp_no); 207 if (find_device_in_mountlist(mountlist, ndevice) >= 0) 207 208 npos++; 209 paranoid_free(ndevice); 208 210 } 209 211 paranoid_free(device); … … 500 502 501 503 /*@ buffers ******************************************************** */ 502 char *tmp; 503 char *device; 504 char *tmp = NULL; 505 char *tmp1 = NULL; 506 char *device = NULL; 504 507 505 508 /*@ long *********************************************************** */ 506 long physical_drive_size = 0 ;507 long amount_allocated = 0 ;509 long physical_drive_size = 0L; 510 long amount_allocated = 0L; 508 511 509 512 /*@ pointers ******************************************************* */ 510 char *part_table_fmt ;513 char *part_table_fmt = NULL; 511 514 512 515 /*@ initialize ***************************************************** */ … … 559 562 continue; 560 563 } 561 // BERLIOS : useless ? str cpy(mountpoint, mountlist->el[pos].mountpoint);564 // BERLIOS : useless ? str-cpy(mountpoint, mountlist->el[pos].mountpoint); 562 565 /* gap in the partition list? */ 563 566 if (curr_part_no - prev_part_no > 1) { … … 751 754 drivelist = malloc(sizeof(struct list_of_disks)); 752 755 assert(mountlist != NULL); 753 assert(flaws_str_A != NULL);754 assert(flaws_str_B != NULL);755 assert(flaws_str_C != NULL);756 756 757 757 asprintf(&flaws_str, " "); -
trunk/mondo/mondo/common/libmondo-msg.c
r537 r783 14 14 * The default maximum level to log messages at or below. 15 15 */ 16 int g_loglevel = DEFAULT_DEBUG_LEVEL;16 extern int g_loglevel; 17 17 18 18 /** -
trunk/mondo/mondo/common/libmondo-raid.c
r689 r783 9 9 10 10 #include "my-stuff.h" 11 #include "mr_string.h" 11 12 #include "mondostructures.h" 12 13 #include "newt-specific-EXT.h" … … 177 178 { 178 179 /*@ buffers ***************************************************** */ 179 char *sz_value; 180 char *sz_value = NULL; 181 char *sz_label = NULL; 180 182 181 183 assert(raidrec != NULL); … … 183 185 184 186 asprintf(&sz_value, "%d", value); 185 strcpy(raidrec->additional_vars.el[lino].label,label);186 strcpy(raidrec->additional_vars.el[lino].value, sz_value);187 paranoid_free(sz_value);187 asprintf(&sz_label,label); 188 raidrec->additional_vars.el[lino].value = sz_value; 189 raidrec->additional_vars.el[lino].label = sz_label; 188 190 } 189 191 #endif … … 956 958 // trim leading spaces 957 959 pos = string; 958 while (*pos == ' ') pos += 1;960 while (*pos == ' ') pos++; 959 961 asprintf(&strtmp, pos); 960 strcpy(string,strtmp);962 paranoid_alloc(string,strtmp); 961 963 paranoid_free(strtmp); 962 964 // if we have newline after only spaces, this is a blank line, update … … 979 981 // get RAID device name 980 982 asprintf(&strtmp,"%s%s", device_prefix, token); 981 strcpy(raidlist->el[raidlist->entries].raid_device, strtmp); 982 paranoid_free(strtmp); 983 raidlist->el[raidlist->entries].raid_device = strtmp; 983 984 paranoid_free(token); 984 985 // skip ':' and status -
trunk/mondo/mondo/common/libmondo-stream.c
r689 r783 543 543 544 544 545 /**546 * FIFO used to read/write to the tape device.547 * @bug This seems obsolete now that we call an external @c buffer program. Please look onto this.548 */549 char g_tape_fifo[MAX_STR_LEN];550 551 545 int set_tape_block_size_with_mt(char *tapedev, 552 546 long internal_tape_block_size) … … 622 616 open_device_via_buffer(bkpinfo->media_device, 'r', 623 617 bkpinfo->internal_tape_block_size))) { 624 log_OS_error(g_tape_fifo);625 618 log_to_screen(_("Cannot openin stream device")); 626 619 return (1); … … 748 741 (g_tape_stream = 749 742 open_device_via_buffer(tapedev, 'w', internal_tape_block_size))) { 750 log_OS_error(g_tape_fifo);751 743 log_to_screen(_("Cannot openin stream device")); 752 744 return (1); … … 1249 1241 open_device_via_buffer(bkpinfo->media_device, 'r', 1250 1242 bkpinfo->internal_tape_block_size))) { 1251 log_OS_error(g_tape_fifo);1252 1243 log_to_screen(_("Cannot openin stream device")); 1253 1244 return (1); … … 1309 1300 open_device_via_buffer(bkpinfo->media_device, 'w', 1310 1301 bkpinfo->internal_tape_block_size))) { 1311 log_OS_error(g_tape_fifo);1312 1302 log_to_screen(_("Cannot openin stream device")); 1313 1303 return (1); -
trunk/mondo/mondo/common/libmondo-string-EXT.h
r588 r783 3 3 */ 4 4 5 extern char *build_partition_name(char *partition, const char *drive, 6 int partno); 5 extern char *build_partition_name(const char *drive, int partno); 7 6 extern void center_string(char *in_out, int width); 8 7 extern char *commarize(char *); … … 44 43 extern inline void turn_wildcard_chars_into_literal_chars(char *out, 45 44 char *in); 46 /* Valid external functions */47 extern char *mr_strtok(char *instr, const char *delims, int *lastpos); -
trunk/mondo/mondo/common/libmondo-string.c
r768 r783 14 14 #include "newt-specific-EXT.h" 15 15 #include "libmondo-tools-EXT.h" 16 #include <math.h> 16 17 17 18 /*@unused@*/ … … 136 137 137 138 138 /*139 * Add commas every third place in @p input.140 * @param input The string to commarize.141 * @return The string with commas.142 * @note The returned string points to static storage that will be overwritten with each call.143 */144 char *commarize(char *input)145 {146 char *pos_w_commas;147 static char output[MAX_STR_LEN];148 char *tmp;149 int j;150 151 assert(input != NULL);152 153 asprintf(&tmp, "%s", input);154 if (strlen(tmp) > 6) {155 asprintf(&pos_w_commas, "%s", tmp);156 j = (int) strlen(pos_w_commas);157 tmp[j - 6] = ',';158 strcpy(tmp + j - 5, pos_w_commas + j - 6);159 paranoid_free(pos_w_commas);160 asprintf(&pos_w_commas, "%s", tmp);161 }162 if (strlen(tmp) > 3) {163 j = (int) strlen(tmp);164 asprintf(&pos_w_commas, "%s", tmp);165 pos_w_commas[j - 3] = ',';166 strcpy(pos_w_commas + j - 2, tmp + j - 3);167 } else {168 asprintf(&pos_w_commas, "%s", tmp);169 }170 strcpy(output, pos_w_commas);171 paranoid_free(pos_w_commas);172 paranoid_free(tmp);173 return (output);174 }175 176 177 139 /** 178 140 * Turn an entry from the RAID editor's disklist into a GUI-friendly string. … … 601 563 602 564 /*@ initialize ****************************************************** */ 603 assert(flaws_str_A != NULL);604 assert(flaws_str_B != NULL);605 assert(flaws_str_C != NULL);606 565 assert(flaws_str != NULL); 607 566 608 flaws_str_A[0] = flaws_str_B[0] = flaws_str_C[0] = '\0'; 609 567 flaws_str_A = NULL; 568 flaws_str_B = NULL; 569 flaws_str_C = NULL; 610 570 611 571 if (!res && !strlen(flaws_str)) { … … 613 573 } 614 574 if (strlen(flaws_str) > 0) { 615 sprintf(flaws_str_A, "%s", flaws_str + 1);575 asprintf(&flaws_str_A, "%s", flaws_str + 1); 616 576 } 617 577 if (strlen(flaws_str_A) >= 74) { 618 578 for (i = 74; flaws_str_A[i] != ' '; i--); 619 strcpy(flaws_str_B, flaws_str_A + i + 1);579 asprintf(&flaws_str_B, "%s", flaws_str_A + i + 1); 620 580 flaws_str_A[i] = '\0'; 621 581 } 622 582 if (strlen(flaws_str_B) >= 74) { 623 583 for (i = 74; flaws_str_B[i] != ' '; i--); 624 strcpy(flaws_str_C, flaws_str_B + i + 1);584 asprintf(&flaws_str_C, "%s", flaws_str_B + i + 1); 625 585 flaws_str_B[i] = '\0'; 626 586 } … … 834 794 if (c && strncmp(c, "/part", 5) == 0) { 835 795 /* yup it's devfs, return the "disc" path */ 836 str cpy(c + 1, "disc");796 strncpy(c + 1, "disc", (size_t)5); 837 797 return partition; 838 798 } … … 1027 987 /*@ int *********************************************** */ 1028 988 int percentage = 0; 1029 int i ;1030 int j ;989 int i = 0; 990 int j = 0; 1031 991 1032 992 /*@ buffers ******************************************* */ 1033 char *outstr; 1034 char *tmp; 1035 char *tmp1; 1036 char *tmp2; 1037 char *prepstr; 1038 char *p; 993 char *outstr = NULL; 994 char *tmp1 = NULL; 995 char *tmp2 = NULL; 996 char *prepstr = NULL; 997 char *p = NULL; 1039 998 1040 999 assert(bkpinfo != NULL); 1041 1000 1042 1001 if (bkpinfo->media_size[g_current_media_number] <= 0) { 1043 asprintf(&tmp, "%lld", g_tape_posK); 1044 asprintf(&outstr, _("Volume %d: %s kilobytes archived so far"), 1045 g_current_media_number, commarize(tmp)); 1046 paranoid_free(tmp); 1002 asprintf(&outstr, _("Volume %d: %'lld kilobytes archived so far"), 1003 g_current_media_number, g_tape_posK); 1047 1004 1048 1005 return (outstr); … … 1060 1017 bkpinfo->media_size[g_current_media_number]); 1061 1018 asprintf(&prepstr, "%s %d: [", 1062 media_descriptor_string(bkpinfo->backup_media_type),1019 bkpinfo->backup_media_string, 1063 1020 g_current_media_number); 1064 1021 } … … 1093 1050 return (outstr); 1094 1051 } 1095 1096 /**1097 * Get a string form of @p type_of_bkp.1098 * @param type_of_bkp The backup type to stringify.1099 * @return The stringification of @p type_of_bkp.1100 * @note The returned string points to static storage that will be overwritten with each call.1101 */1102 char *media_descriptor_string(t_bkptype type_of_bkp)1103 {1104 static char *type_of_backup = NULL;1105 1106 if (!type_of_backup) {1107 malloc_string(type_of_backup);1108 }1109 1110 switch (type_of_bkp) {1111 case dvd:1112 strcpy(type_of_backup, "DVD");1113 break;1114 case cdr:1115 strcpy(type_of_backup, "CDR");1116 break;1117 case cdrw:1118 strcpy(type_of_backup, "CDRW");1119 break;1120 case tape:1121 strcpy(type_of_backup, "tape");1122 break;1123 case cdstream:1124 strcpy(type_of_backup, "CDR");1125 break;1126 case udev:1127 strcpy(type_of_backup, "udev");1128 break;1129 case iso:1130 strcpy(type_of_backup, "ISO");1131 break;1132 case nfs:1133 strcpy(type_of_backup, "nfs");1134 break;1135 default:1136 strcpy(type_of_backup, "ISO");1137 }1138 return (type_of_backup);1139 } -
trunk/mondo/mondo/common/libmondo-string.h
r588 r783 3 3 */ 4 4 5 char *build_partition_name(c har *partition, const char *drive, int partno);5 char *build_partition_name(const char *drive, int partno); 6 6 void center_string(char *in_out, int width); 7 7 char *commarize(char *); … … 34 34 char *media_descriptor_string(t_bkptype); 35 35 inline void turn_wildcard_chars_into_literal_chars(char *out, char *in); 36 37 /* Valid external functions */38 char *mr_strtok(char *instr, const char *delims, int *lastpos); -
trunk/mondo/mondo/common/libmondo-tools.c
r689 r783 74 74 75 75 extern t_bkptype g_backup_media_type; 76 extern char *g_backup_media_string; 76 77 77 78 extern bool am_I_in_disaster_recovery_mode(void); … … 281 282 { 282 283 assert(raidrec != NULL); 283 raidrec->raid_device [0] = '\0';284 raidrec->raid_device = NULL; 284 285 raidrec->raid_level = -9; 285 286 raidrec->persistent_superblock = 1; … … 356 357 char *tmp = NULL; 357 358 char *tmp1 = NULL; 358 char call_before_iso_user[MAX_STR_LEN] = "\0";359 char *call_before_iso_user = NULL; 359 360 int rdsiz_MB; 360 361 char *iso_path = NULL; … … 415 416 if (avm / 1024 > rdsiz_MB * 3) { 416 417 if (run_program_and_log_output(command, 5)) { 417 g_tmpfs_mountpt[0] = '\0';418 paranoid_free(g_tmpfs_mountpt); 418 419 log_it("Failed to mount tmpfs"); 419 420 } else { … … 421 422 } 422 423 } else { 423 g_tmpfs_mountpt[0] = '\0';424 paranoid_free(g_tmpfs_mountpt); 424 425 log_it("It doesn't seem you have enough swap to use tmpfs. Fine."); 425 426 } … … 427 428 428 429 if (bkpinfo->use_lzo) { 429 strcpy(bkpinfo->zip_exe, "lzop");430 strcpy(bkpinfo->zip_suffix, "lzo");430 paranoid_alloc(bkpinfo->zip_exe, "lzop"); 431 paranoid_alloc(bkpinfo->zip_suffix, "lzo"); 431 432 } else if (bkpinfo->compression_level != 0) { 432 strcpy(bkpinfo->zip_exe, "bzip2");433 strcpy(bkpinfo->zip_suffix, "bz2");433 paranoid_alloc(bkpinfo->zip_exe, "bzip2"); 434 paranoid_alloc(bkpinfo->zip_suffix, "bz2"); 434 435 } else { 435 bkpinfo->zip_exe[0] = bkpinfo->zip_suffix[0] = '\0'; 436 bkpinfo->zip_exe = NULL; 437 bkpinfo->zip_suffix = NULL; 436 438 } 437 439 … … 470 472 // -m isn't supported by growisofs, BTW... 471 473 } else { 472 sprintf(bkpinfo->call_make_iso,474 asprintf(&bkpinfo->call_make_iso, 473 475 "%s %s -Z %s . 2>> _ERR_", 474 476 mondo_mkisofs_sz, "", bkpinfo->media_device); … … 518 520 519 521 if (bkpinfo->nonbootable_backup) { 520 asprintf(&mondo_mkisofs_sz, "%s -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_", mrconf->mondo_iso_creation_cmd);522 asprintf(&mondo_mkisofs_sz, "%s -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_", bkpinfo->mr_conf->mondo_iso_creation_cmd); 521 523 } else if 522 524 #ifdef __FreeBSD__ … … 539 541 } 540 542 if (bkpinfo->manual_cd_tray) { 541 if (bkpinfo->call_before_iso [0] == '\0') {542 sprintf(bkpinfo->call_before_iso,543 if (bkpinfo->call_before_iso == NULL) { 544 asprintf(&bkpinfo->call_before_iso, 543 545 "%s -o %s/temporary.iso . 2>> _ERR_", 544 546 mondo_mkisofs_sz, bkpinfo->tmpdir); 545 546 strncpy(call_before_iso_user, bkpinfo->call_before_iso, MAX_STR_LEN);547 sprintf (bkpinfo->call_before_iso,547 } else { 548 asprintf(&call_before_iso_user, bkpinfo->call_before_iso); 549 asprintf(&bkpinfo->call_before_iso, 548 550 "( %s -o %s/temporary.iso . 2>> _ERR_ ; %s )", 549 551 mondo_mkisofs_sz, bkpinfo->tmpdir, call_before_iso_user); 552 paranoid_free(call_before_iso_user); 550 553 } 551 554 log_it("bkpinfo->call_before_iso = %s", bkpinfo->call_before_iso); 552 sprintf(bkpinfo->call_make_iso,555 asprintf(&bkpinfo->call_make_iso, 553 556 "%s %s -v %s fs=4m dev=%s speed=%d %s/temporary.iso", 554 557 cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", … … 556 559 bkpinfo->cdrw_speed, bkpinfo->tmpdir); 557 560 } else { 558 sprintf(bkpinfo->call_make_iso,561 asprintf(&bkpinfo->call_make_iso, 559 562 "%s . 2>> _ERR_ | %s %s %s fs=4m dev=%s speed=%d -", 560 563 mondo_mkisofs_sz, cdr_exe, … … 641 644 h_addr)), 642 645 strchr(bkpinfo->nfs_mount, ':')); 643 strcpy(bkpinfo->nfs_mount, ip_address);646 paranoid_alloc(bkpinfo->nfs_mount, ip_address); 644 647 paranoid_free(ip_address); 645 648 } … … 663 666 retval++; 664 667 } 665 if (bkpinfo->include_paths [0] == '\0') {668 if (bkpinfo->include_paths == NULL) { 666 669 // fatal_error ("Why no backup path?"); 667 strcpy(bkpinfo->include_paths, "/");670 asprintf(&bkpinfo->include_paths, "/"); 668 671 } 669 672 chmod(bkpinfo->scratchdir, 0700); 670 673 chmod(bkpinfo->tmpdir, 0700); 671 674 g_backup_media_type = bkpinfo->backup_media_type; 675 paranoid_alloc(g_backup_media_string,bkpinfo->backup_media_string); 672 676 return (retval); 673 677 } … … 712 716 g_current_media_number = 1; 713 717 bkpinfo->postnuke_tarball = NULL; 714 bkpinfo->nfs_mount = NULL;718 paranoid_free(bkpinfo->nfs_mount); 715 719 return (res); 716 720 } … … 748 752 paranoid_free(bkpinfo->restore_path); 749 753 bkpinfo->use_lzo = FALSE; 750 paranoid_free(bkpinfo->do_not_compress_these);751 754 bkpinfo->verify_data = FALSE; 752 755 bkpinfo->backup_data = FALSE; … … 767 770 bkpinfo->optimal_set_size = 0; 768 771 bkpinfo->backup_media_type = none; 772 paranoid_free(bkpinfo->backup_media_string); 769 773 paranoid_alloc(bkpinfo->include_paths, "/"); 770 774 paranoid_free(bkpinfo->exclude_paths); … … 1043 1047 value = NULL; 1044 1048 return (1); 1045 } else if (strstr(value, "/dev/") && strstr(value, "t0") 1049 /* } BERLIOS: Useless: 1050 else if (strstr(value, "/dev/") && strstr(value, "t0") 1046 1051 && !strcmp(label, "media-dev")) { 1047 1052 log_msg(2, "FYI, I shan't read new value for %s - already got %s", 1048 1053 label, value); 1049 1054 return (0); 1050 } else {1055 */ } else { 1051 1056 asprintf(&command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", 1052 1057 label, config_file); … … 1102 1107 1103 1108 log_msg(1, "Started sub"); 1104 log_msg(4, "About to set g_boot_mountpt to \"\""); 1105 asprintf(&g_boot_mountpt, ""); 1106 log_msg(4, "Done. Great. Seeting command to something"); 1109 log_msg(4, "Setting command to something"); 1107 1110 asprintf(&command, 1108 1111 "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1"); … … 1136 1139 asprintf(&tmp1, "mount %s", g_boot_mountpt); 1137 1140 if (run_program_and_log_output(tmp1, 5)) { 1141 /* BERLIOS: Useless ??? 1138 1142 paranoid_free(g_boot_mountpt); 1139 1143 asprintf(&g_boot_mountpt, " "); 1144 */ 1140 1145 log_msg(1, "Plan B"); 1141 1146 if (!run_program_and_log_output("mount /boot", 5)) { … … 1166 1171 1167 1172 log_msg(3, "starting"); 1168 if (g_boot_mountpt [0]) {1173 if (g_boot_mountpt != NULL) { 1169 1174 asprintf(&tmp, "umount %s", g_boot_mountpt); 1170 1175 if (run_program_and_log_output(tmp, 5)) { -
trunk/mondo/mondo/common/libmondo-verify.c
r688 r783 63 63 sync(); 64 64 65 /* s printf (command,65 /* s-printf (command, 66 66 "grep \"afio: \" %s | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort -u | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s", 67 67 stderr_fname, afio_found_changes); … … 152 152 } 153 153 asprintf(&tmp, "Verifying %s #%d's tarballs", 154 media_descriptor_string(bkpinfo->backup_media_type),154 bkpinfo->backup_media_string, 155 155 g_current_media_number); 156 156 open_evalcall_form(tmp); … … 187 187 * - @c restore_path 188 188 * - @c use_lzo 189 * - @c zip_exe190 189 * - @c zip_suffix 191 190 * @param mtpt The mountpoint the CD/DVD/ISO is mounted on. … … 245 244 iamhere("before vsbf"); 246 245 asprintf(&tmp, "Verifying %s#%d's big files", 247 media_descriptor_string(bkpinfo->backup_media_type),246 bkpinfo->backup_media_string, 248 247 g_current_media_number); 249 248 open_evalcall_form(tmp); … … 391 390 /*@ long *********************************************************** */ 392 391 long diffs = 0; 393 /* getcwd(old_pwd,MAX_STR_LEN-1); */394 392 395 393 assert(bkpinfo != NULL); … … 405 403 && strcmp(bkpinfo->zip_suffix, "lzo")) { 406 404 log_msg(2, "OK, I'm going to start using lzop."); 407 strcpy(bkpinfo->zip_exe, "lzop");408 strcpy(bkpinfo->zip_suffix, "lzo");405 paranoid_alloc(bkpinfo->zip_exe, "lzop"); 406 paranoid_alloc(bkpinfo->zip_suffix, "lzo"); 409 407 bkpinfo->use_lzo = TRUE; 410 408 } … … 412 410 && strcmp(bkpinfo->zip_suffix, "bz2")) { 413 411 log_msg(2, "OK, I'm going to start using bzip2."); 414 strcpy(bkpinfo->zip_exe, "bzip2");415 strcpy(bkpinfo->zip_suffix, "bz2");412 paranoid_alloc(bkpinfo->zip_exe, "bzip2"); 413 paranoid_alloc(bkpinfo->zip_suffix, "bz2"); 416 414 bkpinfo->use_lzo = FALSE; 417 415 } … … 478 476 479 477 /* chdir(old_pwd); */ 480 // s printf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);478 // s-printf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE); 481 479 // paranoid_system (tmp); 482 480 // unlink ("/tmp/mondo-verify.err"); -
trunk/mondo/mondo/common/mondostructures.h
r561 r783 88 88 * The label for this RAID variable. 89 89 */ 90 char label[64];90 char *label; 91 91 92 92 /** 93 93 * The value for this RAID variable. 94 94 */ 95 char value[64];95 char *value; 96 96 }; 97 97 … … 214 214 * The name of the RAID device (e.g. /dev/md0). 215 215 */ 216 char raid_device[64];216 char *raid_device; 217 217 218 218 /** … … 303 303 */ 304 304 struct s_bkpinfo { 305 306 /** 307 * Pointer to the configuration structure 308 */ 309 struct s_mr_conf *mr_conf; 310 305 311 /** 306 312 * The device we're backing up to. … … 346 352 * compression_level is 0. 347 353 */ 348 char zip_exe[MAX_STR_LEN / 4];354 char *zip_exe; 349 355 350 356 /** … … 352 358 * bz2, gzip uses gz, etc. Do not include the dot. 353 359 */ 354 char zip_suffix[MAX_STR_LEN / 4];360 char *zip_suffix; 355 361 356 362 /** … … 383 389 384 390 /** 385 * A filename containing a list of extensions, one per line, to not386 * compress. If this is set to "", afio will still exclude a set of well-known387 * compressed files from compression, but biggiefiles that are compressed388 * will be recompressed again.389 */390 char do_not_compress_these[MAX_STR_LEN / 2];391 392 /**393 391 * If TRUE, then we should verify a backup. 394 392 */ … … 465 463 466 464 /** 465 * The string corresponding to the media type 466 */ 467 char *backup_media_string; 468 469 /** 467 470 * Whether we should use a premade filelist or generate our own. 468 471 * If TRUE, then we generate our own filelist from the directories in @p include_paths. … … 476 479 * If you do nothing, "/" will be used. 477 480 */ 478 char include_paths[MAX_STR_LEN*4];481 char *include_paths; 479 482 480 483 /** … … 483 486 * the scratchdir, and the tempdir are automatically excluded. 484 487 */ 485 char exclude_paths[MAX_STR_LEN*4];488 char *exclude_paths; 486 489 487 490 /** … … 490 493 * without overwriting the old ones. Ignored during a backup. 491 494 */ 492 char restore_path[MAX_STR_LEN];495 char *restore_path; 493 496 494 497 /** … … 500 503 * A command to call to make an ISO image. 501 504 */ 502 char call_make_iso[MAX_STR_LEN];505 char *call_make_iso; 503 506 504 507 /** 505 508 * A command to call to burn the ISO image. 506 */ 507 char call_burn_iso[MAX_STR_LEN]; 509 * BERLIOS: Useful ??? 510 */ 511 char *call_burn_iso; 508 512 509 513 /** … … 614 618 bool expanded; 615 619 }; 616 617 618 619 /**620 * A structure to wrap a FIFO device for writing to a tape/CD stream.621 * @bug Is this structure used (w/the move to a standalone @c buffer and all)?622 */623 struct s_wrapfifo {624 /**625 * The device we write to or read from (a FIFO).626 */627 char public_device[MAX_STR_LEN / 4];628 629 /**630 * The actual device that data from the FIFO should be buffered and written to.631 */632 char private_device[MAX_STR_LEN / 4];633 634 /**635 * A buffer for holding data read from the FIFO.636 */637 char internal_buffer_IN_fifo[MAX_STR_LEN / 4];638 639 /**640 * A buffer for holding data to be written to the FIFO.641 */642 char internal_buffer_OUT_fifo[MAX_STR_LEN / 4];643 644 /**645 * If TRUE, then we're writing directly to the tape streamer; if FALSE, we're writing to the FIFO.646 */647 bool writing_to_private_device;648 };649 650 651 620 652 621 /** … … 801 770 }; 802 771 803 struct s_mr conf {804 int ia64_boot_size;805 char * iso_creation_cmd;806 }; 772 struct s_mr_conf { 773 int mindi_ia64_boot_size; 774 char *mondo_iso_creation_cmd; 775 }; -
trunk/mondo/mondo/common/newt-specific.c
r764 r783 14 14 15 15 #include <unistd.h> 16 #include <math.h> 16 17 17 18 #include "my-stuff.h" … … 28 29 //static char cvsid[] = "$Id$"; 29 30 30 31 32 33 34 31 extern pid_t g_mastermind_pid; 32 extern char *g_tmpfs_mountpt; 33 extern char *g_mondo_home; 34 35 extern void set_signals(int); 35 36 36 37 /** … … 41 42 * Whether we are currently in a nested call of fatal_error(). 42 43 */ 43 44 45 46 47 48 49 50 51 52 44 bool g_exiting = FALSE; 45 46 newtComponent g_timeline = NULL, ///< The line of the progress form that shows the time elapsed/remaining 47 g_percentline = NULL, ///< The line of the progress form that shows the percent completed/remaining 48 g_scale = NULL, ///< The progress bar component in the progress form 49 g_progressForm = NULL, ///< The progress form component itself 50 g_blurb1 = NULL, ///< The component for line 1 of the blurb in the progress form 51 g_blurb2 = NULL, ///< The component for line 2 of the blurb in the progress form 52 g_blurb3 = NULL, ///< The component for line 3 (updated continuously) of the blurb in the progress form 53 g_label = NULL; ///< ????? @bug ????? 53 54 54 55 /** 55 56 * Padding above the Newt components, to overcome bugs in Newt. 56 57 */ 57 58 59 60 58 char **err_log_lines = NULL, ///< The list of log lines to show on the screen. 59 *g_blurb_str_1, ///< The string for line 1 of the blurb in the progress form 60 *g_blurb_str_2, ///< The string for line 2 of the blurb in the progress form 61 *g_blurb_str_3; ///< The string for line 3 (updated continuously) of the blurb in the progress form 61 62 newtComponent g_isoform_main = NULL, ///< The evalcall form component itself 62 63 64 65 66 67 68 69 70 71 72 73 74 63 g_isoform_header = NULL, ///< The component for the evalcall form title 64 g_isoform_scale = NULL, ///< The progress bar component in the evalcall form 65 g_isoform_timeline = NULL, ///< The line of the evalcall form that shows the time elapsed/remaining 66 g_isoform_pcline = NULL; ///< The line of the evalcall form that shows the percent completed/remaining 67 long g_isoform_starttime; ///< The time (in seconds since the epoch) that the evalcall form was opened. 68 int g_isoform_old_progress = -1; ///< The most recent progress update of the evalcall form (percent). 69 char *g_isoform_header_str; ///< The string for the evalcall form title. 70 int g_mysterious_dot_counter; ///< The counter for the twirling baton (/ | \\ - ...) on percentage less than 3 71 int g_noof_log_lines = 6; ///< The number of lines to show in the log at the bottom of the screen. 72 int g_noof_rows = 25; ///< The number of rows on the screen. 73 74 int g_currentY = 3; ///< The row to write background progress messages to. Incremented each time a message is written. 75 extern int g_current_media_number; 75 76 pid_t g_main_pid = 0; ///< The PID of the main Mondo process. 76 77 78 79 80 81 82 char *g_selfmounted_isodir; ///< Holds the NFS mountpoint if mounted via mondoarchive.77 long g_maximum_progress = 999; ///< The maximum amount of progress (100%) for the currently opened progress form. 78 long g_current_progress = -999; ///< The current amount of progress (filelist #, etc.) for the currently opened progress form. 79 long g_start_time = 0; ///< The time (in seconds since the epoch) that the progress form was opened. 80 bool g_text_mode = TRUE; ///< If FALSE, use a newt interface; if TRUE, use an ugly (but more compatible) dumb terminal interface. 81 bool g_called_by_xmondo = FALSE; ///< @bug Unneeded w/current XMondo. 82 char *g_erase_tmpdir_and_scratchdir; ///< The command to run to erase the tmpdir and scratchdir at the end of Mondo. 83 char *g_selfmounted_isodir = NULL; ///< Holds the NFS mountpoint if mounted via mondoarchive. 83 84 84 85 /* @} - end of globalGroup */ … … 86 87 //int g_fd_in=-1, g_fd_out=-1; 87 88 88 89 void popup_and_OK(char *); 89 90 90 91 … … 280 281 kill_anything_like_this("ntfsclone"); 281 282 sync(); 282 asprintf(&tmp, "umount %s", g_tmpfs_mountpt); 283 chdir("/"); 284 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) { 285 log_msg(2, "Waiting for child processes to terminate"); 286 sleep(1); 287 run_program_and_log_output(tmp, 5); 288 } 289 paranoid_free(tmp); 283 if (g_tmpfs_mountpt != NULL) { 284 asprintf(&tmp, "umount %s", g_tmpfs_mountpt); 285 chdir("/"); 286 for (i = 0; i < 10 && run_program_and_log_output(tmp, 5); i++) { 287 log_msg(2, "Waiting for child processes to terminate"); 288 sleep(1); 289 run_program_and_log_output(tmp, 5); 290 } 291 paranoid_free(tmp); 292 } 290 293 291 294 if (g_erase_tmpdir_and_scratchdir) { … … 298 301 asprintf(&command, "rmdir %s", g_selfmounted_isodir); 299 302 run_program_and_log_output(command, 5); 303 paranoid_free(g_selfmounted_isodir); 300 304 } 301 305 … … 356 360 asprintf(&command, "rmdir %s", g_selfmounted_isodir); 357 361 run_program_and_log_output(command, 1); 362 paranoid_free(g_selfmounted_isodir); 358 363 } 359 364 // iamhere("foo"); … … 469 474 470 475 if (err_log_lines) { 471 paranoid_free( &err_log_lines[0]);476 paranoid_free(err_log_lines[0]); 472 477 for (i = 1; i < g_noof_log_lines; i++) { 473 478 err_log_lines[i - 1] = err_log_lines[i]; … … 676 681 677 682 /*@ pointers ********************************************************* */ 678 char * entry_value = NULL;683 char **entry_value = NULL; 679 684 680 685 /*@ buffers ********************************************************** */ … … 702 707 newtEntry(2, newtTextboxGetNumLines(text) + 2, 703 708 output, 50, 704 &entry_value, NEWT_FLAG_RETURNEXIT709 entry_value, NEWT_FLAG_RETURNEXIT 705 710 ); 706 711 b_1 = newtButton(6, newtTextboxGetNumLines(text) + 4, _(" OK ")); … … 721 726 // Copy entry_value before destroying the form 722 727 // clearing potentially output before 723 paranoid_alloc(output, entry_value);728 paranoid_alloc(output,*entry_value); 724 729 } 725 730 newtFormDestroy(myForm); -
trunk/mondo/mondo/include/mr_conf.h
r768 r783 31 31 32 32 /*initialization and closing*/ 33 int mr_conf_open(const char *filename);34 void mr_conf_close();33 extern int mr_conf_open(const char *filename); 34 extern void mr_conf_close(); 35 35 36 36 /*read integer number after string str in the current file*/ 37 int mr_conf_iread(const char *field_name);37 extern int mr_conf_iread(const char *field_name); 38 38 39 39 /*read double/float number after string str in the current file*/ 40 double mr_conf_fread(const char *field_name);40 extern double mr_conf_fread(const char *field_name); 41 41 42 42 /* … … 44 44 * This function allocates the string which has to be freed later on 45 45 */ 46 char *mr_conf_sread(const char *field_name);46 extern char *mr_conf_sread(const char *field_name); 47 47 48 48 #endif /* MR_CONF_H */ -
trunk/mondo/mondo/include/mr_string.h
r768 r783 26 26 /* functions (public methods) */ 27 27 28 char *mr_strtok(char *instr, const char *delims, int *lastpos);28 extern char *mr_strtok(char *instr, const char *delims, int *lastpos); 29 29 30 30 #endif /* MR_STRING_H */ -
trunk/mondo/mondo/include/my-stuff.h
r768 r783 22 22 * The main header file for Mondo. 23 23 */ 24 25 /* Required for the use of getline, ... */26 #define _GNU_SOURCE27 24 28 25 #include <stdio.h> -
trunk/mondo/mondo/lib/Makefile.am
r767 r783 2 2 ## Process this file with Automake to generate `Makefile.in' 3 3 ## 4 AM_CPPFLAGS = -DMONDO_SHARE=\"$(pkgdatadir)\" 4 AM_CPPFLAGS = -DMONDO_SHARE=\"$(pkgdatadir)\" -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/mondo/include 5 5 6 6 ## libmr 7 7 noinst_LIBRARIES = libmr.a 8 8 9 libmr_a_SOURCES = mr_conf.c mr_conf.h \ 10 mr_string.c mr_string.h 9 libmr_a_SOURCES = mr_conf.c mr_string.c -
trunk/mondo/mondo/mondoarchive/Makefile.am
r537 r783 2 2 ## Process with Automake to generate Makefile.in 3 3 ## 4 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" 4 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/mondo/include 5 5 6 6 ## Headers … … 10 10 sbin_PROGRAMS = mondoarchive 11 11 mondoarchive_SOURCES = main.c mondo-cli.c 12 mondoarchive_LDADD = ${top_builddir}/mondo/common/libmondo.a 12 mondoarchive_LDADD = ${top_builddir}/mondo/common/libmondo.a ${top_builddir}/mondo/lib/libmr.a -
trunk/mondo/mondo/mondoarchive/main.c
r688 r783 17 17 #include <stdio.h> 18 18 #include <stdlib.h> 19 #include " ../common/my-stuff.h"19 #include "my-stuff.h" 20 20 #include "../common/mondostructures.h" 21 21 #include "../common/libmondo.h" … … 33 33 extern bool g_remount_cdrom_at_end, g_remount_floppy_at_end; 34 34 extern char *g_mondo_home; 35 extern char *g_tmpfs_mountpt;36 35 extern char *g_erase_tmpdir_and_scratchdir; 37 36 extern double g_kernel_version; … … 41 40 long diffs; 42 41 43 extern t_bkptype g_backup_media_type;44 42 extern int g_loglevel; 45 43 46 44 /****************** subroutines used only by main.c ******************/ 47 45 46 extern void mr_archive_init_conf(struct s_mr_conf *mr_conf); 48 47 49 48 /** … … 131 130 { 132 131 struct s_bkpinfo *bkpinfo; 133 struct s_mrconf *mrconf;134 132 char *tmp; 135 133 int res = 0; … … 147 145 } 148 146 149 /* If -V, -v or --version then echo version no. and quit */147 /* If -V, -v or --version then echo version no. and quit */ 150 148 if (argc == 2 151 149 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") … … 155 153 } 156 154 157 /* Initialize variables */ 158 155 /* Initialize variables */ 159 156 malloc_libmondo_global_strings(); 160 161 /* Initialize Configuration Structure */162 mrarchive_init_conf(mrconf);163 157 164 158 res = 0; … … 170 164 } 171 165 172 173 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */ 166 /* Initialize Configuration Structure */ 167 mr_archive_init_conf(bkpinfo->mr_conf); 168 169 170 /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */ 174 171 asprintf(&tmp, "/sbin:/usr/sbin:%s:/usr/local/sbin", getenv("PATH")); 175 172 setenv("PATH", tmp, 1); 176 173 paranoid_free(tmp); 177 174 178 /* Add the ARCH environment variable for ia64 purposes */175 /* Add the ARCH environment variable for ia64 purposes */ 179 176 setenv("ARCH", get_architecture(), 1); 180 177 … … 331 328 /* If we're meant to backup then backup */ 332 329 if (bkpinfo->backup_data) { 333 res = backup_data(bkpinfo , mrconf);330 res = backup_data(bkpinfo); 334 331 retval += res; 335 332 if (res) { -
trunk/mondo/mondo/mondoarchive/mondo-cli.c
r689 r783 7 7 /** @def BOOT_LOADER_CHARS The characters allowed for boot loader on this platform. */ 8 8 9 #include " ../common/my-stuff.h"9 #include "my-stuff.h" 10 10 #include "../common/mondostructures.h" 11 11 #include "mondo-cli-EXT.h" … … 18 18 extern bool g_text_mode; 19 19 extern bool g_skip_floppies; ///< Whether to skip the creation of boot disks 20 extern char g_startdir[MAX_STR_LEN]; ///< ????? @bug ?????21 extern char g_tmpfs_mountpt[MAX_STR_LEN];22 extern bool g_sigpipe;23 24 /*@ file pointer **************************************************/25 extern FILE *g_tape_stream;26 27 /*@ long long *****************************************************/28 extern long long g_tape_posK;29 30 /*@ long **********************************************************/31 extern long g_noof_sets;32 33 /*@ bool******** **************************************************/34 bool g_debugging = FALSE; ///< ????? @bug ????? @ingroup globalGroup35 bool g_running_live = FALSE; ///< ????? @bug ????? @ingroup globalGroup36 20 extern bool g_cd_recovery; 21 extern double g_kernel_version; 22 extern char *resolve_softlinks_to_get_to_actual_device_file(char *); 37 23 38 24 /** … … 44 30 */ 45 31 bool g_ISO_restore_mode = FALSE; 46 47 48 extern double g_kernel_version;49 50 extern int g_current_media_number;51 52 53 54 extern pid_t g_main_pid;55 56 57 58 59 extern char *resolve_softlinks_to_get_to_actual_device_file(char *);60 61 32 62 33 … … 140 111 paranoid_free(tmp); 141 112 142 if (bkpinfo->nfs_mount [0] != '\0') {113 if (bkpinfo->nfs_mount != NULL) { 143 114 store_nfs_config(bkpinfo); 144 115 } … … 303 274 if (!strcmp(bkpinfo->include_paths, "/")) { 304 275 log_msg(2, "'/' is pleonastic."); 305 bkpinfo->include_paths[0] = '\0'; 306 } 307 if (bkpinfo->include_paths[0]) { 308 strcat(bkpinfo->include_paths, " "); 276 bkpinfo->include_paths = NULL; 309 277 } 310 278 asprintf(&tmp1, flag_val['I']); … … 332 300 paranoid_free(tmp1); 333 301 334 strncpy(bkpinfo->include_paths + strlen(bkpinfo->include_paths), 335 flag_val['I'], 336 4*MAX_STR_LEN - strlen(bkpinfo->include_paths)); 302 if (bkpinfo->include_paths == NULL) { 303 asprintf(&tmp1, "%s", flag_val['I']); 304 } else { 305 asprintf(&tmp1, "%s %s", bkpinfo->include_paths, flag_val['I']); 306 } 307 paranoid_alloc(bkpinfo->include_paths,tmp1); 308 paranoid_free(tmp1); 309 337 310 log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths); 338 311 if (bkpinfo->include_paths[0] == '-') { … … 348 321 } 349 322 350 351 323 if (flag_set['J']) { 352 324 if (flag_set['I']) { … … 356 328 } 357 329 bkpinfo->make_filelist = FALSE; 358 strcpy(bkpinfo->include_paths, flag_val['J']); 359 } 330 paranoid_alloc(bkpinfo->include_paths, flag_val['J']); 331 } 332 360 333 if (flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['r']) { 361 334 if (!flag_set['r'] && g_kernel_version <= 2.5 … … 374 347 } 375 348 376 if (system("which cdrecord > /dev/null 2> /dev/null")377 && system("which dvdrecord > /dev/null 2> /dev/null")) {378 fatal_error379 ("Please install dvdrecord/cdrecord and try again.");380 }381 349 if (flag_set['C']) { 382 350 bkpinfo->cdrw_speed = atoi(flag_val['C']); … … 408 376 } 409 377 } 378 410 379 if (flag_set['t'] && !flag_set['d']) { 411 380 log_it("Hmm! No tape drive specified. Let's see what we can do."); … … 437 406 } 438 407 } 439 tmp = find_home_of_exe("growisofs");440 if (!tmp) {441 fatal_error442 ("Please install growisofs (probably part of dvd+rw-tools). If you want DVD support, you need it.");443 }444 paranoid_free(tmp);445 446 tmp = find_home_of_exe("dvd+rw-format");447 if (!tmp) {448 fatal_error449 ("Please install dvd+rw-format (probably part of dvd+rw-tools). If you want DVD support, you need it.");450 }451 paranoid_free(tmp);452 408 453 409 if (strchr(flag_val['d'], ',')) { … … 498 454 } 499 455 if (flag_set['n']) { 500 asprintf(&tmp, flag_val['n']); 501 bkpinfo->nfs_mount = tmp; 456 paranoid_alloc(bkpinfo->nfs_mount,flag_val['n']); 502 457 if (!flag_set['d']) { 503 asprintf(&tmp, "/"); 504 bkpinfo->nfs_remote_dir = tmp; 458 paranoid_alloc(bkpinfo->nfs_remote_dir,"/"); 505 459 } 506 460 asprintf(&tmp, "mount | grep -x \"%s .*\" | cut -d' ' -f3", 507 461 bkpinfo->nfs_mount); 462 paranoid_free(bkpinfo->isodir); 508 463 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp); 509 464 paranoid_free(tmp); … … 516 471 log_msg(3, "isodir= %s", bkpinfo->isodir); 517 472 } 473 518 474 if (flag_set['c']) { 519 475 bkpinfo->backup_media_type = cdr; … … 541 497 } 542 498 543 /* optional, popular */499 /* optional, popular */ 544 500 if (flag_set['g']) { 545 501 g_text_mode = FALSE; 546 502 } 503 547 504 if (flag_set['E']) { 548 if (bkpinfo->exclude_paths[0]) {549 strcat(bkpinfo->exclude_paths, " ");550 }551 505 asprintf(&tmp1, flag_val['E']); 552 506 p = tmp1; … … 571 525 paranoid_free(tmp1); 572 526 573 strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths), 574 flag_val['E'], 575 4*MAX_STR_LEN - strlen(bkpinfo->exclude_paths)); 576 } 527 if (bkpinfo->exclude_paths == NULL) { 528 asprintf(&tmp1, "%s", flag_val['E']); 529 } else { 530 asprintf(&tmp1, "%s %s", bkpinfo->exclude_paths, flag_val['E']); 531 } 532 paranoid_alloc(bkpinfo->exclude_paths,tmp1); 533 paranoid_free(tmp1); 534 } 535 577 536 if (flag_set['e']) { 578 537 bkpinfo->please_dont_eject = TRUE; 579 538 } 539 580 540 if (flag_set['N']) // exclude NFS mounts & devices 581 541 { 582 542 psz = list_of_NFS_mounts_only(); 583 if (bkpinfo->exclude_paths[0]) { 584 strncat(bkpinfo->exclude_paths, " ", MAX_STR_LEN); 585 } 586 strncat(bkpinfo->exclude_paths, psz, MAX_STR_LEN); 543 if (bkpinfo->exclude_paths != NULL) { 544 asprintf(&tmp1, "%s %s", bkpinfo->exclude_paths, psz); 545 } else { 546 asprintf(&tmp1, "%s", psz); 547 } 587 548 paranoid_free(psz); 549 paranoid_alloc(bkpinfo->exclude_paths, tmp1); 550 paranoid_free(tmp1); 588 551 589 552 log_msg(3, "-N means we're now excluding %s", 590 553 bkpinfo->exclude_paths); 591 554 } 592 if (strlen(bkpinfo->exclude_paths) >= MAX_STR_LEN) { 593 fatal_error 594 ("Your '-E' parameter is too long. Please use '-J'. (See manual.)"); 595 } 555 596 556 if (flag_set['b']) { 597 557 asprintf(&psz, flag_val['b']); … … 613 573 bkpinfo->internal_tape_block_size = itbs; 614 574 } 575 615 576 if (flag_set['D']) { 616 577 bkpinfo->differential = 1; … … 621 582 } 622 583 } 584 623 585 if (flag_set['x']) { 624 asprintf(&tmp, flag_val['x']); 625 bkpinfo->image_devs = tmp; 586 paranoid_alloc(bkpinfo->image_devs,flag_val['x']); 626 587 if (run_program_and_log_output("which ntfsclone", 2)) { 627 588 fatal_error("Please install ntfsprogs package/tarball."); 628 589 } 629 590 } 591 630 592 if (flag_set['m']) { 631 593 bkpinfo->manual_cd_tray = TRUE; 632 594 } 595 633 596 if (flag_set['k']) { 634 597 if (strcasecmp(flag_val['k'], "FAILSAFE")) { 635 asprintf(&tmp, "FAILSAFE"); 636 bkpinfo->kernel_path = tmp; 598 paranoid_alloc(bkpinfo->kernel_path,"FAILSAFE"); 637 599 638 600 if (!does_file_exist(bkpinfo->kernel_path)) { … … 645 607 } 646 608 } else { 647 asprintf(&tmp,flag_val['k']);648 bkpinfo->kernel_path = tmp;649 650 } 609 paranoid_alloc(bkpinfo->kernel_path,flag_val['k']); 610 } 611 } 612 651 613 if (flag_set['p']) { 652 asprintf(&tmp, bkpinfo->prefix); 653 bkpinfo->prefix = tmp; 654 } 655 614 paranoid_alloc(bkpinfo->prefix,flag_val['p']); 615 } 656 616 657 617 if (flag_set['d']) { /* backup directory (if ISO/NFS) */ 658 618 if (flag_set['i']) { 659 asprintf(&tmp, flag_val['d']); 660 bkpinfo->isodir = tmp; 619 paranoid_alloc(bkpinfo->isodir,flag_val['d']); 661 620 asprintf(&tmp, "ls -l %s", bkpinfo->isodir); 662 621 if (run_program_and_log_output(tmp, FALSE)) { … … 666 625 paranoid_free(tmp); 667 626 } else if (flag_set['n']) { 668 asprintf(&tmp, flag_val['d']); 669 bkpinfo->nfs_remote_dir = tmp; 627 paranoid_alloc(bkpinfo->nfs_remote_dir,flag_val['d']); 670 628 } else { /* backup device (if tape/CD-R/CD-RW) */ 671 629 … … 698 656 } 699 657 } else if ((tmp = find_cdrw_device()) == NULL) { 700 paranoid_ free(bkpinfo->media_device);701 bkpinfo->media_device = tmp;658 paranoid_alloc(bkpinfo->media_device, tmp); 659 paranoid_free(tmp); 702 660 retval++; 703 661 log_to_screen … … 723 681 j = (int) random() % 32768; 724 682 if (flag_set['S']) { 725 asprintf(&tmp, "%s/mondo.scratch.% ld", flag_val['S'], j);683 asprintf(&tmp, "%s/mondo.scratch.%d", flag_val['S'], j); 726 684 paranoid_free(bkpinfo->scratchdir); 727 685 bkpinfo->scratchdir = tmp; 728 686 } 729 687 if (flag_set['T']) { 730 asprintf(&tmp, "%s/mondo.tmp.% ld", flag_val['T'], j);688 asprintf(&tmp, "%s/mondo.tmp.%d", flag_val['T'], j); 731 689 paranoid_free(bkpinfo->tmpdir); 732 690 bkpinfo->tmpdir = tmp; … … 750 708 paranoid_free(tmp); 751 709 } 710 752 711 if (flag_set['A']) { 753 asprintf(&tmp, flag_val['A']); 754 bkpinfo->call_after_iso = tmp; 712 paranoid_alloc(bkpinfo->call_after_iso,flag_val['A']); 755 713 } 756 714 if (flag_set['B']) { 757 asprintf(&tmp, flag_val['B']); 758 bkpinfo->call_before_iso = tmp; 715 paranoid_alloc(bkpinfo->call_before_iso,flag_val['B']); 759 716 } 760 717 if (flag_set['F']) { … … 784 741 #undef BOOT_LOADER_CHARS 785 742 } 743 744 tmp = NULL; 786 745 if (flag_set['f']) { 787 746 tmp = resolve_softlinks_to_get_to_actual_device_file(flag_val['f']); 788 bkpinfo->boot_device = tmp;747 paranoid_alloc(bkpinfo->boot_device,tmp); 789 748 } 790 749 if (flag_set['Q']) { … … 796 755 log_msg(3, "boot loader is %c, residing at %s", i, tmp); 797 756 printf(_("boot loader is %c, residing at %s\n"), i, tmp); 757 paranoid_free(tmp); 798 758 finish(0); 799 759 } … … 801 761 802 762 if (flag_set['P']) { 803 asprintf(&tmp,flag_val['P']);804 bkpinfo->postnuke_tarball = tmp;805 } 763 paranoid_alloc(bkpinfo->postnuke_tarball,flag_val['P']); 764 } 765 806 766 if (flag_set['L']) { 807 767 bkpinfo->use_lzo = TRUE; … … 821 781 (_("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary.")); 822 782 } 783 823 784 if (flag_set['o']) { 824 785 bkpinfo->make_cd_use_lilo = TRUE; -
trunk/mondo/mondo/mondorestore/Makefile.am
r426 r783 2 2 ## Process with Automake to generate Makefile.in 3 3 ## 4 5 AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/mondo/include 4 6 5 7 ## Headers … … 12 14 mondorestore_SOURCES = mondo-prep.c mondo-restore.c mondo-rstr-newt.c \ 13 15 mondo-rstr-compare.c mondo-rstr-tools.c 14 mondorestore_LDADD = ${top_builddir}/mondo/common/libmondo.a @MONDORESTORE_STATIC@ 16 mondorestore_LDADD = ${top_builddir}/mondo/common/libmondo.a ${top_builddir}/mondo/lib/libmr.a @MONDORESTORE_STATIC@ 17 18 -
trunk/mondo/mondo/mondorestore/mondo-prep.c
r764 r783 9 9 10 10 11 #include " ../common/my-stuff.h"11 #include "my-stuff.h" 12 12 #include "../common/mondostructures.h" 13 13 #include "mondoprep.h" … … 53 53 char *command; 54 54 int lino; 55 int i;56 55 FILE *fout; 57 56 char *buf; 58 const int blocksize = 512;59 57 struct list_of_disks *drivelist = NULL; 60 58 // If LVMs are present and a zero-and-reboot wasn't recently undertaken 61 59 // then zero & insist on reboot. 62 buf = malloc(blocksize);63 60 if (does_file_exist("/tmp/i-want-my-lvm")) // FIXME - cheating :) 64 61 { … … 89 86 log_to_screen("Please hit 'Enter' to reboot."); 90 87 for (lino = 0; lino < drivelist->entries; lino++) { 91 for (i = 0; i < blocksize; i++) { 92 buf[i] = 0; 93 } 94 sprintf(buf, "%s\n", MONDO_WAS_HERE); 88 asprintf(&buf, "%s\n", MONDO_WAS_HERE); 95 89 fout = fopen(drivelist->el[lino].device, "w+"); 96 90 if (!fout) { … … 98 92 drivelist->el[lino].device); 99 93 } else { 100 if (1 != fwrite(buf, blocksize, 1, fout)) {94 if (1 != fwrite(buf, strlen(buf)+1, 1, fout)) { 101 95 log_msg(1, "Failed to wipe %s", 102 96 drivelist->el[lino].device); … … 107 101 fclose(fout); 108 102 } 103 paranoid_free(buf); 109 104 } 110 105 sync(); … … 257 252 for (getline(&incoming, &n1, fin); !feof(fin); getline(&incoming, &n1, fin)) { 258 253 fgetpos(fin, &orig_pos); 259 /* BERLIOS : Strange no ?*/254 /* we want to execute lines begining with a # */ 260 255 if (incoming[0] != '#') { 261 256 continue; … … 268 263 } 269 264 if ((p = strstr(incoming, "vgcreate"))) { 270 // include next line(s) if they end in /dev (cos we've got a broken i-want-my-lvm)265 // include next line(s) if they end in /dev (cos we've got a broken i-want-my-lvm) 271 266 for (getline(&tmp, &n, fin); !feof(fin); getline(&tmp, &n, fin)) { 272 267 if (tmp[0] == '#') { … … 287 282 } 288 283 } 289 malloc_string(tmp1); 290 strcpy(tmp1, p + strlen("vgcreate") + 1); 284 asprintf(&tmp1, p + strlen("vgcreate") + 1); 291 285 for (q = tmp1; *q > 32; q++); 292 286 *q = '\0'; … … 294 288 asprintf(&tmp, "rm -Rf /dev/%s", tmp1); 295 289 paranoid_free(tmp1); 290 296 291 run_program_and_log_output(tmp, 1); 297 292 paranoid_free(tmp); … … 304 299 } 305 300 for (p = incoming + 1; *p == ' '; p++); 306 paranoid_free(command); 307 asprintf(&command, p); 301 paranoid_alloc(command,p); 308 302 for (p = command; *p != '\0'; p++); 309 303 for (; *(p - 1) < 32; p--); 310 304 *p = '\0'; 305 306 /* BERLIOS: we should rather define LVMv1 or v2 and use it */ 311 307 res = run_program_and_log_output(command, 5); 312 308 if (res > 0 && (p = strstr(command, "lvm "))) { … … 338 334 log_msg(5, "p='%s' --> extents=%ld", p, extents); 339 335 paranoid_free(tmp); 336 340 337 p = strstr(command, "-L"); 341 338 if (!p) { … … 349 346 *q = ' '; 350 347 } 348 /* BERLIOS: Dangerous: no size control !! */ 351 349 sprintf(p, "%ld", extents); 352 350 i = strlen(p); … … 359 357 *(q - 1) = ' '; 360 358 } 359 /* BERLIOS: Dangerous: no size control !! */ 361 360 sprintf(p, "%ld%c", extents, 'm'); 362 361 i = strlen(p); … … 673 672 char *tmp = NULL; 674 673 char *tmp1 = NULL; 674 #ifdef __FreeBSD__ 675 675 char *line = NULL; 676 676 char *status = NULL; … … 679 679 size_t n = 0; 680 680 size_t n1 = 0; 681 #endif 681 682 682 683 /** end ****************************************************************/ … … 1525 1526 // If so, then we just call label_drive_or_slice() and return. 1526 1527 char c; 1528 char *command; 1529 1527 1530 if (current_devno == 1) { 1528 1531 // try DangerouslyDedicated mode … … 1538 1541 drivename, 1539 1542 0); 1540 char command[MAX_STR_LEN]; 1541 sprintf(command, "disklabel -B %s", 1543 asprintf(&command, "disklabel -B %s", 1542 1544 basename(drivename)); 1543 1545 if (system(command)) { … … 1546 1548 ("Warning! Unable to make the drive bootable.")); 1547 1549 } 1550 paranoid_free(command); 1548 1551 paranoid_free(device_str); 1549 1552 … … 2077 2080 asprintf(&partcode, "8e"); 2078 2081 } else if (format[0] == '\0') { /* LVM physical partition */ 2079 asprintf(&partcode, " ");2082 asprintf(&partcode, "%s", ""); 2080 2083 } else if (strlen(format) >= 1 && strlen(format) <= 2) { 2081 2084 asprintf(&partcode, format); … … 2375 2378 2376 2379 assert_string_is_neither_NULL_nor_zerolength(format); 2377 assert(program != NULL);2378 2380 2379 2381 if (strcmp(format, "swap") == 0) { 2380 2382 #ifdef __FreeBSD__ 2381 strcpy(program, "true");2383 asprintf(&program, "true"); 2382 2384 #else 2383 strcpy(program, "mkswap");2385 asprintf(&program, "mkswap"); 2384 2386 #endif 2385 2387 } else if (strcmp(format, "vfat") == 0) { 2386 strcpy(program, "format-and-kludge-vfat");2388 asprintf(&program, "format-and-kludge-vfat"); 2387 2389 #ifndef __FreeBSD__ 2388 2390 } else if (strcmp(format, "reiserfs") == 0) { 2389 strcpy(program, "mkreiserfs -ff");2391 asprintf(&program, "mkreiserfs -ff"); 2390 2392 } else if (strcmp(format, "xfs") == 0) { 2391 strcpy(program, "mkfs.xfs -f -q");2393 asprintf(&program, "mkfs.xfs -f -q"); 2392 2394 } else if (strcmp(format, "jfs") == 0) { 2393 strcpy(program, "mkfs.jfs");2395 asprintf(&program, "mkfs.jfs"); 2394 2396 } else if (strcmp(format, "ext3") == 0) { 2395 strcpy(program, "mkfs -t ext2 -F -j -q");2397 asprintf(&program, "mkfs -t ext2 -F -j -q"); 2396 2398 } else if (strcmp(format, "minix") == 0) { 2397 strcpy(program, "mkfs.minix");2399 asprintf(&program, "mkfs.minix"); 2398 2400 #endif 2399 2401 } else if (strcmp(format, "ext2") == 0) { 2400 strcpy(program, "mke2fs -F -q");2402 asprintf(&program, "mke2fs -F -q"); 2401 2403 } else { 2402 2404 #ifdef __FreeBSD__ 2403 sprintf(program, "newfs_%s", format);2405 asprintf(&program, "newfs_%s", format); 2404 2406 #else 2405 sprintf(program, "mkfs -t %s -c", format); // -c checks for bad blocks2407 asprintf(&program, "mkfs -t %s -c", format); // -c checks for bad blocks 2406 2408 #endif 2407 2409 asprintf(&tmp, "Unknown format (%s) - assuming '%s' will do", format, … … 2504 2506 } 2505 2507 2506 /*2507 sprintf (tmp, "cp -f %s %s.pre-resize", g_mountlist_fname, g_mountlist_fname);2508 run_program_and_log_output (tmp, FALSE);2509 */2510 2511 2508 current_size_of_drive = get_phys_size_of_drive(drive_name); 2512 2509 … … 2600 2597 assert(mountlist != NULL); 2601 2598 2602 if (g_mountlist_fname [0] == '\0') {2599 if (g_mountlist_fname == NULL) { 2603 2600 log_it 2604 2601 ("resize_mountlist_prop...() - warning - mountlist fname is blank"); … … 2648 2645 if (c && strncmp(c, "/disc", 5) == 0) { 2649 2646 /* yup its devfs, change the "disc" to "part" so the existing code works */ 2650 str cpy(c + 1, "part");2647 strncpy(c + 1, "part", (size_t)5); 2651 2648 } 2652 2649 drivemntlist->entries = 0; -
trunk/mondo/mondo/mondorestore/mondo-restore-EXT.h
r688 r783 10 10 extern bool g_ISO_restore_mode; /* are we in Iso Mode? */ 11 11 extern bool g_I_have_just_nuked; 12 extern char *g_tmpfs_mountpt;13 12 extern char *g_isodir_device; 14 13 extern char *g_isodir_format; … … 32 31 struct raidlist_itself *); 33 32 extern void sort_mountlist_by_device(struct mountlist_itself *); 34 extern void find_pathname_of_executable_preferably_in_RESTORING(char *,35 char *,36 char *);37 33 extern int interactive_mode(struct s_bkpinfo *, struct mountlist_itself *, 38 34 struct raidlist_itself *); … … 53 49 extern int restore_a_biggiefile_from_CD(struct s_bkpinfo *, long, 54 50 struct s_node *); 55 extern int restore_a_biggiefile_from_stream(struct s_bkpinfo *, char *, 56 long, char *, long long, 57 struct s_node *); 51 extern char *restore_a_biggiefile_from_stream(struct s_bkpinfo *, char *, 52 long, struct s_node *, int); 58 53 extern int restore_a_tarball_from_CD(char *, int, struct s_node *); 59 54 extern int restore_a_tarball_from_stream(struct s_bkpinfo *, char *, int, -
trunk/mondo/mondo/mondorestore/mondo-restore.c
r689 r783 13 13 #include <unistd.h> 14 14 15 #include " ../common/my-stuff.h"15 #include "my-stuff.h" 16 16 #include "../common/mondostructures.h" 17 17 #include "../common/libmondo.h" … … 158 158 assert(raidlist != NULL); 159 159 if (!bkpinfo->disaster_recovery) { 160 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");160 paranoid_alloc(g_mountlist_fname, "/tmp/mountlist.txt"); 161 161 log_msg(2, "I guess you're testing edit_mountlist()"); 162 162 } … … 310 310 /************************************************************************** 311 311 *END_ EXTRACT_CONFIG_FILE_FROM_RAMDISK * 312 **************************************************************************/313 314 315 /**316 * Locate an executable in the directory structure rooted at @p restg.317 * @param out_path Where to put the executable.318 * @param fname The basename of the executable.319 * @param restg The directory structure to look in.320 * @note If it could not be found in @p restg then @p fname is put in @p out_path.321 * @ingroup restoreUtilityGroup322 */323 void324 find_pathname_of_executable_preferably_in_RESTORING(char *out_path,325 char *fname,326 char *restg)327 {328 assert(out_path != NULL);329 assert_string_is_neither_NULL_nor_zerolength(fname);330 331 sprintf(out_path, "%s/sbin/%s", restg, fname);332 if (does_file_exist(out_path)) {333 sprintf(out_path, "%s/usr/sbin/%s", restg, fname);334 if (does_file_exist(out_path)) {335 sprintf(out_path, "%s/bin/%s", restg, fname);336 if (does_file_exist(out_path)) {337 sprintf(out_path, "%s/usr/bin/%s", restg, fname);338 if (does_file_exist(out_path)) {339 strcpy(out_path, fname);340 }341 }342 }343 }344 }345 346 /**************************************************************************347 *END_FIND_PATHNAME_OF_EXECUTABLE_PREFERABLY_IN_RESTORING *348 312 **************************************************************************/ 349 313 … … 534 498 ask_me_yes_or_no 535 499 (_("Do you want me to restore _some_ of your data?")))) { 536 old_restpath = bkpinfo->restore_path;500 asprintf(&old_restpath,bkpinfo->restore_path); 537 501 for (done = FALSE; !done;) { 538 502 unlink("/tmp/filelist.full"); … … 548 512 if (!strcmp(bkpinfo->restore_path, "/")) { 549 513 if (!ask_me_yes_or_no(_("Are you sure?"))) { 550 paranoid_free(bkpinfo->restore_path); 551 bkpinfo->restore_path = old_restpath; 514 paranoid_alloc(bkpinfo->restore_path, old_restpath); 552 515 goto gotos_suck; 553 516 } … … 558 521 free_filelist(filelist); 559 522 } else { 560 bkpinfo->restore_path = old_restpath;523 paranoid_alloc(bkpinfo->restore_path,old_restpath); 561 524 free_filelist(filelist); 562 525 } … … 569 532 } 570 533 } 534 paranoid_free(old_restpath); 571 535 } else { 572 536 mvaddstr_and_log_it(g_currentY++, … … 630 594 ("Warning - errors occurred during the restore phase.")); 631 595 } 596 return(retval); 632 597 } 633 598 … … 750 715 bool boot_loader_installed = FALSE; 751 716 char *tmp = NULL; 752 char tmpA[MAX_STR_LEN];753 char tmpB[MAX_STR_LEN];754 char tmpC[MAX_STR_LEN];717 char *tmpA = NULL; 718 char *tmpB = NULL; 719 char *tmpC = NULL; 755 720 756 721 assert(bkpinfo != NULL); … … 807 772 tmp = call_program_and_get_last_line_of_output("cat /proc/cmdline"); 808 773 #endif 809 if (strstr(tmp, ,"nopart")) {774 if (strstr(tmp,"nopart")) { 810 775 log_msg(2, 811 776 "Not partitioning drives due to 'nopart' option."); … … 949 914 if (filelist) { 950 915 save_filelist(filelist, "/tmp/selected-files.txt"); 951 old_restpath = bkpinfo->restore_path;916 asprintf(&old_restpath,bkpinfo->restore_path); 952 917 if (popup_and_get_string(_("Restore path"), 953 918 _("Restore files to where? )"), … … 957 922 } 958 923 free_filelist(filelist); 959 bkpinfo->restore_path = old_restpath;924 paranoid_alloc(bkpinfo->restore_path,old_restpath); 960 925 } 961 926 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 1012 977 char *bigblk = NULL; 1013 978 char *pathname_of_last_file_restored = NULL; 1014 int retval = 0;1015 979 int finished = FALSE; 1016 980 long sliceno; … … 1172 1136 asprintf(&tmp3, 1173 1137 "Asking for %s #%d so that I may read slice #%ld\n", 1174 media_descriptor_string(bkpinfo->backup_media_type),1138 bkpinfo->backup_media_string, 1175 1139 g_current_media_number, sliceno); 1176 1140 log_msg(2, tmp3); … … 1178 1142 1179 1143 asprintf(&tmp3, _("Restoring from %s #%d"), 1180 media_descriptor_string(bkpinfo->backup_media_type),1144 bkpinfo->backup_media_string, 1181 1145 g_current_media_number); 1182 1146 log_to_screen(tmp3); … … 1198 1162 asprintf(&bzip2_command, "bzip2 -dc %s 2>> %s",tmp2, MONDO_LOGFILE); 1199 1163 } else if (does_file_exist(tmp)) { 1200 asprintf(&bzip2_command, " ");1164 asprintf(&bzip2_command, "%s", ""); 1201 1165 } else { 1202 1166 log_to_screen(_("OK, that's pretty fsck0red...")); … … 1209 1173 } 1210 1174 asprintf(&tmp3, "Working on %s #%d, file #%ld, slice #%ld ", 1211 media_descriptor_string(bkpinfo->backup_media_type),1175 bkpinfo->backup_media_string, 1212 1176 g_current_media_number, bigfileno + 1, sliceno); 1213 1177 log_msg(2, tmp3); … … 1300 1264 char *command = NULL; 1301 1265 char *outfile_fname = NULL; 1302 char *ntfsprog_command = NULL;1303 1266 char *ntfsprog_fifo = NULL; 1304 1267 char *file_to_openout = NULL; … … 1418 1381 } 1419 1382 1420 if ( !bkpinfo->zip_exe[0]) {1383 if (bkpinfo->zip_exe == NULL) { 1421 1384 asprintf(&command, "cat > \"%s\"", file_to_openout); 1422 1385 } else { … … 1649 1612 asprintf(&tmp, " -bz"); 1650 1613 } else { 1651 asprintf(&tmp, " ");1614 asprintf(&tmp, "%s", ""); 1652 1615 } 1653 1616 asprintf(&command, … … 1792 1755 "Restoring from fileset #%ld (%ld KB) on %s #%d", 1793 1756 current_tarball_number, (long) size >> 10, 1794 media_descriptor_string(bkpinfo->backup_media_type),1757 bkpinfo->backup_media_string, 1795 1758 g_current_media_number); 1796 1759 log_msg(2, tmp); … … 1869 1832 // star 1870 1833 if (filelist) { 1871 asprintf(&command, "star -x file=%s %s list=%s 2>> %s", afio_fname, executable 1834 asprintf(&command, "star -x file=%s %s list=%s 2>> %s", afio_fname, executable, 1872 1835 filelist_subset_fname,MONDO_LOGFILE); 1873 1836 } else { … … 1946 1909 long noof_biggiefiles = 0L, bigfileno = 0L, total_slices = 0L; 1947 1910 char *tmp = NULL; 1911 char *tmp1 = NULL; 1948 1912 bool just_changed_cds = FALSE, finished = FALSE; 1949 1913 char *xattr_fname = NULL; … … 1997 1961 log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d", 1998 1962 bigfileno + 1, 1999 media_descriptor_string(bkpinfo->backup_media_type),1963 bkpinfo->backup_media_string, 2000 1964 g_current_media_number); 2001 1965 tmp1 = slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, ""); … … 2012 1976 ++g_current_media_number); 2013 1977 asprintf(&tmp, _("Restoring from %s #%d"), 2014 media_descriptor_string(bkpinfo-> 2015 backup_media_type), 1978 bkpinfo->backup_media_string, 2016 1979 g_current_media_number); 2017 1980 log_to_screen(tmp); … … 2124 2087 2125 2088 asprintf(&progress_str, _("Restoring from %s #%d"), 2126 media_descriptor_string(bkpinfo->backup_media_type),2089 bkpinfo->backup_media_string, 2127 2090 g_current_media_number); 2128 2091 log_to_screen(progress_str); … … 2174 2137 paranoid_free(progress_str); 2175 2138 asprintf(&progress_str, _("Restoring from %s #%d"), 2176 media_descriptor_string(bkpinfo->backup_media_type),2139 bkpinfo->backup_media_string, 2177 2140 g_current_media_number); 2178 2141 log_to_screen(progress_str); … … 2182 2145 _("Restoring from fileset #%ld on %s #%d"), 2183 2146 current_tarball_number, 2184 media_descriptor_string(bkpinfo->backup_media_type),2147 bkpinfo->backup_media_string, 2185 2148 g_current_media_number); 2186 2149 // log_msg(3, "progress_str = %s", progress_str); … … 2198 2161 } 2199 2162 asprintf(&tmp, _("%s #%d, fileset #%ld - restore %s"), 2200 media_descriptor_string(bkpinfo->backup_media_type),2163 bkpinfo->backup_media_string, 2201 2164 g_current_media_number, current_tarball_number,tmp1); 2202 2165 paranoid_free(tmp1); … … 2260 2223 char *xattr_fname = NULL; 2261 2224 char *acl_fname = NULL; 2262 char *p = NULL;2263 2225 char *pathname_of_last_biggie_restored = NULL; 2264 2226 char *biggies_whose_EXATs_we_should_set = NULL; // EXtended ATtributes 2265 long long biggie_size = NULL;2266 FILE *fbw = NULL;2227 long long biggie_size = (long long)0; 2228 FILE *fbw; 2267 2229 2268 2230 assert(bkpinfo != NULL); … … 2506 2468 asprintf(&progress_str, _("Restoring from fileset #%ld on %s #%d"), 2507 2469 current_afioball_number, 2508 media_descriptor_string(bkpinfo->backup_media_type),2470 bkpinfo->backup_media_string, 2509 2471 g_current_media_number); 2510 2472 res = … … 2735 2697 malloc_libmondo_global_strings(); 2736 2698 2737 g_mondo_home = call_program_and_get_last_line_of_output("which mondorestore") );2738 sprintf(g_tmpfs_mountpt, "/tmp/tmpfs");2699 g_mondo_home = call_program_and_get_last_line_of_output("which mondorestore"); 2700 paranoid_alloc(g_tmpfs_mountpt, "/tmp/tmpfs"); 2739 2701 make_hole_for_dir(g_tmpfs_mountpt); 2740 2702 g_current_media_number = 1; // precaution … … 2746 2708 reset_bkpinfo(bkpinfo); 2747 2709 bkpinfo->backup_media_type = none; // in case boot disk was made for one backup type but user wants to restore from another backup type 2710 bkpinfo->backup_media_string = NULL; 2748 2711 bkpinfo->restore_data = TRUE; // Well, yeah :-) 2749 2712 if (am_I_in_disaster_recovery_mode()) { … … 2757 2720 2758 2721 log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname); 2759 if (strlen(g_mountlist_fname) < 3) {2760 fatal_error2761 ("Serious error in malloc()'ing. Could be a bug in your glibc.");2762 }2763 2722 mkdir(MNT_CDROM, 0x770); 2764 2723 … … 2812 2771 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 2813 2772 if (!does_file_exist(g_mountlist_fname)) { 2814 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");2773 paranoid_alloc(g_mountlist_fname, "/tmp/mountlist.txt"); 2815 2774 } 2816 2775 res = let_user_edit_the_mountlist(bkpinfo, mountlist, raidlist); … … 2839 2798 bkpinfo->compression_level = 1; 2840 2799 g_current_media_number = 2; 2841 strcpy(bkpinfo->restore_path, "/tmp/TESTING");2800 paranoid_alloc(bkpinfo->restore_path, "/tmp/TESTING"); 2842 2801 bkpinfo->backup_media_type = dvd; 2802 paranoid_free(bkpinfo->backup_media_string); 2803 bkpinfo->backup_media_string = bkptype_to_string(bkpinfo->backup_media_type); 2843 2804 open_progress_form(_("Reassembling /dev/hda1"), 2844 2805 _("Shark is a bit of a silly person."), … … 2965 2926 2966 2927 iamhere("About to call load_mountlist and load_raidtab"); 2967 strcpy(bkpinfo->restore_path, MNT_RESTORING);2928 paranoid_alloc(bkpinfo->restore_path, MNT_RESTORING); 2968 2929 read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo); 2969 2930 retval = load_mountlist(mountlist, g_mountlist_fname); … … 2978 2939 && !is_this_device_mounted(bkpinfo->nfs_mount)) { 2979 2940 log_msg(1, "Mounting nfs dir"); 2980 sprintf(bkpinfo->isodir, "/tmp/isodir");2941 paranoid_alloc(bkpinfo->isodir, "/tmp/isodir"); 2981 2942 run_program_and_log_output("mkdir -p /tmp/isodir", 5); 2982 2943 asprintf(&tmp, "mount %s -t nfs -o nolock /tmp/isodir", … … 3000 2961 log_msg(0, "Partitioning only."); 3001 2962 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3002 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");2963 paranoid_alloc(g_mountlist_fname, "/tmp/mountlist.txt"); 3003 2964 load_mountlist(mountlist, g_mountlist_fname); 3004 2965 res = partition_everything(mountlist); … … 3009 2970 log_msg(0, "Formatting only."); 3010 2971 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3011 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");2972 paranoid_alloc(g_mountlist_fname, "/tmp/mountlist.txt"); 3012 2973 load_mountlist(mountlist, g_mountlist_fname); 3013 2974 res = format_everything(mountlist, FALSE, raidlist); … … 3018 2979 log_msg(0, "Stopping LVM and RAID"); 3019 2980 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3020 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");2981 paranoid_alloc(g_mountlist_fname, "/tmp/mountlist.txt"); 3021 2982 load_mountlist(mountlist, g_mountlist_fname); 3022 2983 res = do_my_funky_lvm_stuff(TRUE, FALSE); -
trunk/mondo/mondo/mondorestore/mondo-restore.h
r688 r783 10 10 int catchall_mode(struct s_bkpinfo *, struct mountlist_itself *, 11 11 struct raidlist_itself *); 12 void find_pathname_of_executable_preferably_in_RESTORING(char *, char *,13 char *);14 12 int interactive_mode(struct s_bkpinfo *, struct mountlist_itself *, 15 13 struct raidlist_itself *); … … 22 20 int restore_mode(struct s_bkpinfo *, struct mountlist_itself *, 23 21 struct raidlist_itself *); 24 int restore_a_biggiefile_from_stream(struct s_bkpinfo *, char *, long, 25 char *, long long, struct s_node *, 26 int, char *); 22 char *restore_a_biggiefile_from_stream(struct s_bkpinfo *, char *, long, 23 struct s_node *, int); 27 24 int restore_a_tarball_from_CD(char *, long, struct s_node *); 28 25 int restore_a_tarball_from_stream(struct s_bkpinfo *, char *, long, -
trunk/mondo/mondo/mondorestore/mondo-rstr-compare.c
r689 r783 4 4 5 5 6 #include " ../common/my-stuff.h"6 #include "my-stuff.h" 7 7 #include "../common/mondostructures.h" 8 8 #include "../common/libmondo.h" … … 44 44 char *p = NULL; 45 45 int i = 0; 46 int n = 0;46 size_t n = 0; 47 47 int retval = 0; 48 48 … … 258 258 } 259 259 paranoid_free(tmp); 260 260 261 if (use_star) { 261 262 if (strcmp(compressor_exe, "bzip2")) { … … 264 265 } 265 266 } else { 266 asprintf(&tmp, compressor_exe);267 sprintf(compressor_exe, "-P %s -Z", tmp);267 tmp = compressor_exe; 268 asprintf(&compressor_exe, "-P %s -Z", tmp); 268 269 paranoid_free(tmp); 269 270 } … … 299 300 log_OS_error(command); 300 301 } 302 paranoid_free(command); 303 301 304 if (length_of_file(logfile) > 5) { 302 sprintf(command,305 asprintf(&command, 303 306 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vx \"dev/.*\" >> /tmp/changed.txt", 304 307 logfile); 305 308 system(command); 309 paranoid_free(command); 306 310 archiver_errors = count_lines_in_file(logfile); 307 311 } else { 308 312 archiver_errors = 0; 309 313 } 310 paranoid_free(command);311 314 312 315 if (archiver_errors) { … … 353 356 354 357 asprintf(&progress_str, _("Comparing with %s #%d "), 355 media_descriptor_string(bkpinfo->backup_media_type),358 bkpinfo->backup_media_string, 356 359 g_current_media_number); 357 360 … … 402 405 paranoid_free(progress_str); 403 406 asprintf(&progress_str, _("Comparing with %s #%d "), 404 media_descriptor_string(bkpinfo->backup_media_type),407 bkpinfo->backup_media_string, 405 408 g_current_media_number); 406 409 log_to_screen(progress_str); -
trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c
r764 r783 537 537 char *personalities = NULL; 538 538 char *prompt = NULL; 539 char *sz = NULL;540 539 int out = 0, res = 0; 541 540 … … 544 543 system 545 544 ("grep Pers /proc/mdstat > /tmp/raid-personalities.txt 2> /dev/null"); 546 personalities = last_line_of_file("/tmp/raid-personalities.txt") );545 personalities = last_line_of_file("/tmp/raid-personalities.txt"); 547 546 asprintf(&prompt, _("Please enter the RAID level you want. %s"), 548 547 personalities); … … 616 615 int i = 0; 617 616 int pos = 0; 618 619 /** buffers ***********************************************************/620 char *tmp = NULL;621 617 622 618 assert(mountlist != NULL); … … 858 854 popup_and_OK(tmp); 859 855 } else { 856 paranoid_free(av->el[lino].label); 857 paranoid_free(av->el[lino].value); 860 858 memcpy((void *) &av->el[lino], (void *) &av->el[av->entries--], 861 859 sizeof(struct raid_var_line)); 860 /* BERLIOS: New way of doing should be replaced by line below. Hope it's ok. 861 * Will be when memory for struct is also dynamically allocated 862 av->el[lino] = av->el[av->entries--]; 863 */ 862 864 } 863 865 } … … 1323 1325 device); 1324 1326 if (j < 0) { 1325 sprintf(tmp,1327 asprintf(&tmp, 1326 1328 _ 1327 1329 ("/etc/raidtab does not have an entry for %s; please delete it and add it again"), 1328 1330 mountlist->el[currline].device); 1329 1331 popup_and_OK(tmp); 1332 paranoid_free(tmp); 1330 1333 } else { 1331 1334 log_it(_("edit_raidlist_entry - calling")); … … 1499 1502 1500 1503 void *keylist[10]; 1501 void *curr_choice ;1504 void *curr_choice = NULL; 1502 1505 1503 1506 int currline2 = 0; … … 1971 1974 raidrec->additional_vars.el[lino].label, sz_out); 1972 1975 if (popup_and_get_string(header, comment, sz_out)) { 1973 strcpy(raidrec->additional_vars.el[lino].value, sz_out); 1976 paranoid_free(raidrec->additional_vars.el[lino].value); 1977 raidrec->additional_vars.el[lino].value = sz_out; 1974 1978 } 1975 1979 paranoid_free(header); 1976 1980 paranoid_free(comment); 1977 paranoid_free(sz_out);1978 1981 } 1979 1982 #endif … … 2015 2018 int currline = 0; 2016 2019 int finished = FALSE; 2020 int res = 0; 2017 2021 2018 2022 /** buffers **********************************************************/ … … 2025 2029 assert(raidlist != NULL); 2026 2030 2027 asprintf(&flaws_str_A, "xxxxxxxxx");2028 asprintf(&flaws_str_B, "xxxxxxxxx");2029 asprintf(&flaws_str_C, "xxxxxxxxx");2030 2031 if (mountlist->entries > ARBITRARY_MAXIMUM) { 2031 2032 log_to_screen(_("Arbitrary limits suck, man!")); … … 2045 2046 _("Format"), _("Size (MB)")); 2046 2047 headerMsg = newtLabel(2, 1, tmp); 2047 flawsLabelA = newtLabel(2, 13, flaws_str_A);2048 flawsLabelB = newtLabel(2, 14, flaws_str_B);2049 flawsLabelC = newtLabel(2, 15, flaws_str_C);2048 flawsLabelA = newtLabel(2, 13, "x"); 2049 flawsLabelB = newtLabel(2, 14, "x"); 2050 flawsLabelC = newtLabel(2, 15, "x"); 2050 2051 partitionsListbox = 2051 2052 newtListbox(2, 2, 10, NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); … … 2057 2058 bEdit, bDelete, bReload, bCancel, bOK, NULL); 2058 2059 while (!finished) { 2059 evaluate_mountlist(mountlist, flaws_str_A, flaws_str_B,2060 res = evaluate_mountlist(mountlist, flaws_str_A, flaws_str_B, 2060 2061 flaws_str_C); 2061 2062 newtLabelSetText(flawsLabelA, flaws_str_A); 2062 2063 newtLabelSetText(flawsLabelB, flaws_str_B); 2063 2064 newtLabelSetText(flawsLabelC, flaws_str_C); 2065 2066 paranoid_free(flaws_str_A); 2067 paranoid_free(flaws_str_B); 2068 paranoid_free(flaws_str_C); 2069 2064 2070 b_res = newtRunForm(myForm); 2065 2071 /* BERLIOS: This needs to be re-written */ 2066 2072 if (b_res == bOK) { 2067 if (!evaluate_mountlist 2068 (mountlist, flaws_str_A, flaws_str_B, flaws_str_C)) { 2073 if (!res) { 2069 2074 finished = 2070 2075 ask_me_yes_or_no … … 2113 2118 } 2114 2119 } 2115 paranoid_free(flaws_str_A);2116 paranoid_free(flaws_str_B);2117 paranoid_free(flaws_str_C);2118 2120 } 2119 2121 newtFormDestroy(myForm); … … 2413 2415 raidrec = &raidlist->el[pos_in_raidlist]; 2414 2416 initialize_raidrec(raidrec); 2415 strcpy(raidrec->OSSWAP(raid_device, volname),2417 asprintf(&raidrec->OSSWAP(raid_device, volname), 2416 2418 OSSWAP(device, basename(device))); 2417 2419 #ifndef __FreeBSD__ … … 2647 2649 (void *) &raidrec->additional_vars.el[i], 2648 2650 sizeof(struct raid_var_line)); 2651 /* BERLIOS : To be changed */ 2649 2652 } 2650 2653 raidrec->additional_vars.entries--; -
trunk/mondo/mondo/mondorestore/mondo-rstr-newt.h
r688 r783 3 3 **/ 4 4 5 #include " ../common/my-stuff.h"5 #include "my-stuff.h" 6 6 #include "../common/mondostructures.h" 7 7 #include "../common/libmondo.h" -
trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c
r764 r783 5 5 #include <unistd.h> 6 6 7 #include " ../common/my-stuff.h"7 #include "my-stuff.h" 8 8 #include "../common/mondostructures.h" 9 9 #include "../common/libmondo.h" … … 39 39 40 40 extern t_bkptype g_backup_media_type; 41 extern char *g_backup_media_string; 41 42 42 43 extern int g_partition_table_locked_up; … … 290 291 assert(bkpinfo != NULL); 291 292 g_ISO_restore_mode = TRUE; 293 294 paranoid_free(g_isodir_device); 292 295 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 293 296 if (bkpinfo->disaster_recovery) { 294 297 /* Patch Conor Daly 26-june-2004 295 298 * Don't let this clobber an existing bkpinfo->isodir */ 296 if (!bkpinfo->isodir [0]) {297 strcpy(bkpinfo->isodir, "/tmp/isodir");299 if (!bkpinfo->isodir) { 300 paranoid_alloc(bkpinfo->isodir, "/tmp/isodir"); 298 301 } 299 302 /* End patch */ … … 344 347 i = what_number_cd_is_this(bkpinfo); /* has the side-effect of calling mount_cdrom() */ 345 348 asprintf(&tmp, "%s #%d has been mounted via loopback mount", 346 media_descriptor_string(bkpinfo->backup_media_type), i);349 bkpinfo->backup_media_string, i); 347 350 log_msg(1, tmp); 348 351 paranoid_free(tmp); … … 497 500 { 498 501 char *mount_cmd = NULL; 499 char *tmp = NULL;500 502 int i, res; 501 503 #ifdef __FreeBSD__ … … 519 521 log_msg(2, "Mounting for NFS thingy"); 520 522 log_msg(2, "isodir = %s", bkpinfo->isodir); 521 if ((!bkpinfo->isodir [0]|| !strcmp(bkpinfo->isodir, "/"))523 if ((!bkpinfo->isodir || !strcmp(bkpinfo->isodir, "/")) 522 524 && am_I_in_disaster_recovery_mode()) { 523 strcpy(bkpinfo->isodir, "/tmp/isodir");525 paranoid_alloc(bkpinfo->isodir, "/tmp/isodir"); 524 526 log_msg(1, "isodir is being set to %s", bkpinfo->isodir); 525 527 } … … 663 665 asprintf(&p2, ",user_xattr"); 664 666 } else { 665 asprintf(&p2, " ");667 asprintf(&p2, "%s", ""); 666 668 } 667 669 paranoid_free(tmp); … … 671 673 asprintf(&p3, ",acl"); 672 674 } else { 673 asprintf(&p3, " ");675 asprintf(&p3, "%s", ""); 674 676 } 675 677 paranoid_free(tmp); … … 789 791 char *value = NULL; 790 792 char *tmp = NULL; 793 char *tmp1 = NULL; 791 794 char *command = NULL; 792 795 char *iso_mnt = NULL; … … 836 839 837 840 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 838 paranoid_free(bkpinfo->prefix); 839 bkpinfo->prefix = value; 841 paranoid_alloc(bkpinfo->prefix,value); 840 842 } else { 841 843 paranoid_alloc(bkpinfo->prefix, STD_PREFIX); … … 845 847 paranoid_free(value); 846 848 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 847 paranoid_free(bkpinfo->prefix); 848 bkpinfo->prefix = value; 849 paranoid_alloc(bkpinfo->prefix,value); 849 850 } else { 850 851 paranoid_alloc(bkpinfo->prefix, STD_PREFIX); … … 869 870 } else if (bkpinfo->backup_media_type == tape 870 871 || bkpinfo->backup_media_type == udev) { 872 paranoid_free(bkpinfo->media_device); 871 873 if (read_cfg_var(cfg_file, "media-dev", bkpinfo->media_device)) { 872 874 fatal_error("Cannot get tape device name from cfg file"); … … 964 966 "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place"); 965 967 } else { 968 paranoid_free(bkpinfo->nfs_mount); 969 paranoid_free(bkpinfo->nfs_remote_dir); 966 970 read_cfg_var(g_mondo_cfg_file, "nfs-server-mount", 967 971 bkpinfo->nfs_mount); … … 976 980 * isodir in disaster recovery mode 977 981 */ 978 old_isodir = bkpinfo->isodir;982 paranoid_alloc(old_isodir,bkpinfo->isodir); 979 983 read_cfg_var(g_mondo_cfg_file, "iso-mnt", iso_mnt); 980 984 read_cfg_var(g_mondo_cfg_file, "isodir", iso_path); 981 985 if (iso_mnt && iso_path) { 986 paranoid_free(bkpinfo->isodir); 982 987 asprintf(&bkpinfo->isodir, "%s%s", iso_mnt, iso_path); 983 } else {984 bkpinfo->isodir = old_isodir;985 988 } 986 989 paranoid_free(iso_mnt); … … 992 995 ("user nominated isodir differs from archive, keeping user's choice: %s %s\n", 993 996 old_isodir, bkpinfo->isodir); 994 if (bkpinfo->isodir != old_isodir) { 995 paranoid_free(old_isodir); 996 } 997 } else { 998 paranoid_free(old_isodir); 999 } 1000 } 1001 997 } 998 } 999 paranoid_free(old_isodir); 1000 1001 paranoid_free(g_isodir_device); 1002 1002 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 1003 1003 log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir, g_isodir_device); … … 1029 1029 paranoid_free(iso_mnt); 1030 1030 paranoid_free(iso_path); 1031 asprintf(&iso_mnt, " ");1032 asprintf(&iso_path, " ");1031 asprintf(&iso_mnt, "%s", ""); 1032 asprintf(&iso_path, "%s", ""); 1033 1033 1034 1034 if (mount_cdrom(bkpinfo)) { … … 1069 1069 } 1070 1070 g_backup_media_type = bkpinfo->backup_media_type; 1071 bkpinfo->backup_media_string = bkptype_to_string(bkpinfo->backup_media_type); 1072 g_backup_media_string = bkpinfo->backup_media_string; 1071 1073 return (0); 1072 1074 } … … 1823 1825 assert(bkpinfo != NULL); 1824 1826 1825 malloc_string(g_tmpfs_mountpt);1826 1827 1827 asprintf(&g_biggielist_txt, "%s/%s",bkpinfo->tmpdir , BIGGIELIST_TXT_STUB); 1828 1828 asprintf(&g_filelist_full, "%s/%s", bkpinfo->tmpdir, FILELIST_FULL_STUB); … … 1830 1830 asprintf(&g_imagedevs_restthese, "%s/tmp/imagedevs.restore-these", 1831 1831 bkpinfo->tmpdir); 1832 paranoid_free(g_mondo_cfg_file); 1833 paranoid_free(g_mountlist_fname); 1832 1834 if (bkpinfo->disaster_recovery) { 1833 1835 asprintf(&g_mondo_cfg_file, "/%s", MONDO_CFG_FILE_STUB); … … 2110 2112 { 2111 2113 int retval = 0; 2112 char *device = NULL;2113 2114 char *command = NULL; 2114 2115 char *cfg_file = NULL; … … 2364 2365 2365 2366 g_backup_media_type = bkpinfo->backup_media_type; 2367 bkpinfo->backup_media_string = bkptype_to_string(bkpinfo->backup_media_type); 2368 g_backup_media_string = bkpinfo->backup_media_string; 2366 2369 return (retval); 2367 2370 } -
trunk/monitas/client.c
r353 r783 152 152 char *get_param_from_rcfile(char*fname, char*field) 153 153 { 154 char command[MAX_STR_LEN+1], tmp[MAX_STR_LEN+1]; 154 char command[MAX_STR_LEN+1]; 155 char tmp[MAX_STR_LEN+1]; 155 156 static char sz_res[MAX_STR_LEN+1]; 156 157 -
trunk/tools/mg
r407 r783 1 egrep -ri $* . | egrep -v '\.svn|~:' | less1 egrep -ri $* . | egrep -v '\.svn|~:'
Note:
See TracChangeset
for help on using the changeset viewer.