source: MondoRescue/branches/stable/mondo/src/common/libmondo-tools.c@ 1213

Last change on this file since 1213 was 1213, checked in by Bruno Cornec, 17 years ago

Removal of g_mondo_home useless and used MONDO_SHARE instead

  • Property svn:keywords set to Id
File size: 35.4 KB
Line 
1/* $Id: libmondo-tools.c 1213 2007-02-26 13:04:43Z bruno $
2misc tools
3*/
4
5/**
6 * @file
7 * Miscellaneous tools that didn't really fit anywhere else.
8 */
9
10#include "my-stuff.h"
11#include "mr_mem.h"
12#include "mr_msg.h"
13#include "mr_file.h"
14
15#include "mondostructures.h"
16#include "libmondo-tools.h"
17#include "newt-specific-EXT.h"
18#include "libmondo-files-EXT.h"
19#include "libmondo-fork-EXT.h"
20#include "libmondo-raid-EXT.h"
21#include <sys/socket.h>
22#include <netdb.h>
23#include <netinet/in.h>
24#include <arpa/inet.h>
25
26/*@unused@*/
27//static char cvsid[] = "$Id: libmondo-tools.c 1213 2007-02-26 13:04:43Z bruno $";
28
29extern int g_tape_buffer_size_MB;
30extern char *g_erase_tmpdir_and_scratchdir;
31extern char *g_serial_string;
32extern bool g_text_mode;
33extern int g_currentY;
34extern int g_current_media_number;
35
36/**
37 * @addtogroup globalGroup
38 * @{
39 */
40bool g_remount_cdrom_at_end, ///< TRUE if we unmounted the CD-ROM and should remount it when done with the backup.
41 g_remount_floppy_at_end; ///< TRUE if we unmounted the floppy and should remount it when done with the backup.
42bool g_cd_recovery; ///< TRUE if we're making an "autonuke" backup.
43double g_kernel_version;
44
45/**
46 * The place where /boot is mounted. - Used locally only
47 */
48static char *g_boot_mountpt = NULL;
49
50/**
51 * The serial string (used to differentiate between backups) of the current backup.
52 */
53char *g_serial_string = NULL;
54
55/**
56 * The location where tmpfs is mounted, or "" if it's not mounted.
57 */
58char *g_tmpfs_mountpt = NULL;
59char *g_magicdev_command = NULL;
60
61/**
62 * The default maximum level to log messages at or below.
63 */
64int g_loglevel = DEFAULT_DEBUG_LEVEL;
65
66/* @} - end of globalGroup */
67
68
69extern pid_t g_buffer_pid;
70extern pid_t g_main_pid;
71
72extern t_bkptype g_backup_media_type;
73extern char *g_backup_media_string;
74
75extern bool am_I_in_disaster_recovery_mode(void);
76
77
78/**
79 * @addtogroup utilityGroup
80 * @{
81 */
82/**
83 * Assertion handler. Prints a friendly message to the user,
84 * offering to ignore all, dump core, break to debugger,
85 * exit, or ignore. Intended to be used with an assert() macro.
86 *
87 * @param file The file in which the assertion triggered.
88 * @param function The function (@c __FUNCTION__) in which the assertion triggered.
89 * @param line The line number of the assert() statement.
90 * @param exp The expression that failed (as a string).
91 */
92void _mondo_assert_fail(const char *file,
93 const char *function, int line, const char *exp)
94{
95 static int ignoring_assertions = 0;
96 bool is_valid = TRUE;
97
98 log_it("ASSERTION FAILED: `%s' at %s:%d in %s", exp, file, line,
99 function);
100 if (ignoring_assertions) {
101 log_it("Well, the user doesn't care...");
102 return;
103 }
104#ifndef _XWIN
105 if (!g_text_mode)
106 newtSuspend();
107#endif
108 printf(_("ASSERTION FAILED: `%s'\n"), exp);
109 printf(_("\tat %s:%d in %s\n\n"), file, line, function);
110 printf(_("(I)gnore, ignore (A)ll, (D)ebug, a(B)ort, or (E)xit? "));
111 do {
112 is_valid = TRUE;
113 switch (toupper(getchar())) {
114 case 'A': // ignore (A)ll
115 ignoring_assertions = 1;
116 break;
117 case 'B': // a(B)ort
118 signal(SIGABRT, SIG_DFL); /* prevent SIGABRT handler from running */
119 raise(SIGABRT);
120 break; /* "can't get here" */
121 case 'D': // (D)ebug, aka asm("int 3")
122#ifdef __IA32__
123 __asm__ __volatile__("int $3"); // break to debugger
124#endif
125 break;
126 case 'E': // (E)xit
127 fatal_error("Failed assertion -- see above for details");
128 break; /* "can't get here" */
129 case 'I': // (I)gnore
130 break;
131 /* These next two work as follows:
132 the `default' catches the user's invalid choice and says so;
133 the '\n' catches the newline on the end and prints the prompt again.
134 */
135 case '\n':
136 printf
137 (_("(I)gnore, ignore (A)ll, (D)ebug, a(B)ort, or (E)xit? "));
138 break;
139 default:
140 is_valid = FALSE;
141 printf(_("Invalid choice.\n"));
142 break;
143 }
144 } while (!is_valid);
145
146 if (ignoring_assertions) {
147 log_it("Ignoring ALL assertions from now on.");
148 } else {
149 log_it("Ignoring assertion: %s", exp);
150 }
151
152 getchar(); // skip \n
153
154#ifndef _XWIN
155 if (!g_text_mode)
156 newtResume();
157#endif
158}
159
160/**
161 * Clean's up users' KDE desktops.
162 * @bug Details about this function are unknown.
163 */
164void clean_up_KDE_desktop_if_necessary(void)
165{
166 char *tmp;
167
168 mr_asprintf(&tmp,
169 "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \
170file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \
171awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \
172else { print $0;};}' $file.old > $file ; fi ; done");
173 run_program_and_log_output(tmp, 5);
174 mr_free(tmp);
175}
176
177
178/**
179 * Locate mondoarchive's home directory. Searches in /usr/share/mondo,
180 * /usr/local/share/mondo, /opt, or if all else fails, search /usr.
181 *
182 * @param home_sz String to store the home directory ("" if it could not be found).
183 * @return 0 for success, nonzero for failure.
184 */
185int find_and_store_mondoarchives_home(char *home_sz)
186{
187 assert(home_sz != NULL);
188 strcpy(home_sz, MONDO_SHARE);
189 return (0);
190}
191
192
193char *get_architecture(void)
194{
195#ifdef __IA32__
196 return ("i386");
197#endif
198#ifdef __X86_64__
199 return ("x86_64");
200#endif
201#ifdef __IA64__
202 return ("ia64");
203#endif
204 return ("unknown");
205}
206
207
208/* BERLIOS: Use uname instead */
209double get_kernel_version(void)
210{
211 char *p, tmp[200];
212 double d;
213#ifdef __FreeBSD__
214 // JOSH - FIXME :)
215 d = 5.2; // :-)
216#else
217 strcpy(tmp, call_program_and_get_last_line_of_output("uname -r"));
218 p = strchr(tmp, '.');
219 if (p) {
220 p = strchr(++p, '.');
221 if (p) {
222 while (*p) {
223 *p = *(p + 1);
224 p++;
225 }
226 }
227 }
228// mr_msg(1, "tmp = '%s'", tmp);
229 d = atof(tmp);
230#endif
231 mr_msg(1, "g_kernel_version = %f", d);
232 return (d);
233}
234
235
236/**
237 * Get the current time.
238 * @return number of seconds since the epoch.
239 */
240long get_time(void)
241{
242 return (long) time((void *) 0);
243}
244
245
246/**
247 * Initialize a RAID volume structure, setting fields to zero. The
248 * actual hard drive is unaffected.
249 *
250 * @param raidrec The RAID volume structure to initialize.
251 * @note This function is system dependent.
252 */
253#ifdef __FreeBSD__
254void initialize_raidrec(struct vinum_volume *raidrec)
255{
256 int i, j;
257 raidrec->volname[0] = '\0';
258 raidrec->plexes = 0;
259 for (i = 0; i < 9; ++i) {
260 raidrec->plex[i].raidlevel = -1;
261 raidrec->plex[i].stripesize = 0;
262 raidrec->plex[i].subdisks = 0;
263 for (j = 0; j < 9; ++j) {
264 strcpy(raidrec->plex[i].sd[j].which_device, "");
265 }
266 }
267}
268#else
269void initialize_raidrec(struct raid_device_record *raidrec)
270{
271 assert(raidrec != NULL);
272 raidrec->raid_device[0] = '\0';
273 raidrec->raid_level = -9;
274 raidrec->persistent_superblock = 1;
275 raidrec->chunk_size = 64;
276 raidrec->parity = -1;
277 raidrec->data_disks.entries = 0;
278 raidrec->spare_disks.entries = 0;
279 raidrec->parity_disks.entries = 0;
280 raidrec->failed_disks.entries = 0;
281 raidrec->additional_vars.entries = 0;
282}
283#endif
284
285
286/**
287 * Insert modules that Mondo requires.
288 * Currently inserts @c dos, @c fat, @c vfat, and @c osst for Linux;
289 * @c msdosfs and @c ext2fs for FreeBSD.
290 */
291void insmod_crucial_modules(void)
292{
293#ifdef __FreeBSD__
294 system("kldstat | grep msdosfs || kldload msdosfs 2> /dev/null");
295 system("kldstat | grep ext2fs || kldload ext2fs 2> /dev/null");
296#else
297 system("modprobe -a dos fat vfat loop &> /dev/null");
298#endif
299}
300
301
302/**
303 * Finish configuring the backup information structure. Call this function
304 * to set the parameters that depend on those that can be given on the command
305 * line.
306 *
307 * @param bkpinfo The backup information structure. Fields modified/used:
308 * - Used: @c bkpinfo->backup_data
309 * - Used: @c bkpinfo->backup_media_type
310 * - Used: @c bkpinfo->cdrw_speed
311 * - Used: @c bkpinfo->compression_level
312 * - Used: @c bkpinfo->include_paths
313 * - Used: @c bkpinfo->prefix
314 * - Used: @c bkpinfo->isodir
315 * - Used: @c bkpinfo->manual_cd_tray
316 * - Used: @c bkpinfo->make_cd_use_lilo
317 * - Used: @c bkpinfo->media_device
318 * - Used: @c bkpinfo->nfs_mount
319 * - Used: @c bkpinfo->nonbootable_backup
320 * - Used: @c bkpinfo->scratchdir
321 * - Used: @c bkpinfo->tmpdir
322 * - Used: @c bkpinfo->use_lzo
323 * - Modified: @c bkpinfo->call_before_iso
324 * - Modified: @c bkpinfo->call_make_iso
325 * - Modified: @c bkpinfo->optimal_set_size
326 * - Modified: @c bkpinfo->zip_exe
327 * - Modified: @c bkpinfo->zip_suffix
328 *
329 * @return number of errors, or 0 for success.
330 * @note Also creates directories that are specified in the @c bkpinfo structure but
331 * do not exist.
332 */
333int post_param_configuration(struct s_bkpinfo *bkpinfo)
334{
335 char *extra_cdrom_params = NULL;
336 char *mondo_mkisofs_sz = NULL;
337 char *command = NULL;
338 char *hostname = NULL;
339 char *ip_address = NULL;
340 int retval = 0;
341 long avm = 0;
342 char *colon = NULL;
343 char *cdr_exe = NULL;
344 char *tmp = NULL;
345 char *call_before_iso_user = NULL;
346 int rdsiz_MB;
347 char *iso_dev = NULL;
348 char *iso_mnt = NULL;
349 char *iso_tmp = NULL;
350 char *iso_path = NULL;
351 FILE *fd1 = NULL;
352
353 assert(bkpinfo != NULL);
354 bkpinfo->optimal_set_size =
355 (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type) ? 16 : 16) *
356 1024;
357
358 mr_msg(1, "Foo");
359 if (bkpinfo->backup_media_type == tape) {
360 mr_msg(1, "Bar");
361 mr_asprintf(&tmp, "mt -f %s status", bkpinfo->media_device);
362 mr_msg(1, "tmp = '%s'", tmp);
363 if (run_program_and_log_output(tmp, 3)) {
364 fatal_error
365 ("Unable to open tape device. If you haven't specified it with -d, do so. If you already have, check your parameter. I think it's wrong.");
366 }
367 mr_free(tmp);
368 }
369 make_hole_for_dir(bkpinfo->scratchdir);
370 make_hole_for_dir(bkpinfo->tmpdir);
371 if (bkpinfo->backup_media_type == iso)
372 make_hole_for_dir(bkpinfo->isodir);
373
374 run_program_and_log_output("uname -a", 5);
375 run_program_and_log_output("cat /etc/*-release", 5);
376 run_program_and_log_output("cat /etc/*issue*", 5);
377 sprintf(g_tmpfs_mountpt, "%s/tmpfs", bkpinfo->tmpdir);
378 mr_asprintf(&command, "mkdir -p %s", g_tmpfs_mountpt);
379 paranoid_system(command);
380 mr_free(command);
381 rdsiz_MB = PPCFG_RAMDISK_SIZE + g_tape_buffer_size_MB;
382#ifdef __FreeBSD__
383 mr_asprintf(&tmp,
384 call_program_and_get_last_line_of_output
385 ("vmstat | tail -1 | tr -s ' ' | cut -d' ' -f6"));
386 avm += atol(tmp);
387 mr_free(tmp);
388 mr_asprintf(&tmp,
389 call_program_and_get_last_line_of_output
390 ("swapinfo | grep -v Device | tr -s ' ' | cut -d' ' -f4 | tr '\n' '+' | sed 's/+$//' | bc"));
391 avm += atol(tmp);
392 mr_free(tmp);
393 mr_asprintf(&command, "mdmfs -s %d%c md9 %s", rdsiz_MB, 'm',
394 g_tmpfs_mountpt);
395#else
396 mr_asprintf(&tmp,
397 call_program_and_get_last_line_of_output
398 ("free | grep ':' | tr -s ' ' '\t' | cut -f2 | head -n1"));
399 avm += atol(tmp);
400 mr_free(tmp);
401 mr_asprintf(&command, "mount /dev/shm -t tmpfs %s -o size=%d%c",
402 g_tmpfs_mountpt, rdsiz_MB, 'm');
403 run_program_and_log_output("cat /proc/cpuinfo", 5);
404 /* BERLIOS: rpm is not necessarily there ! */
405 run_program_and_log_output
406 ("rpm -q newt newt-devel slang slang-devel ncurses ncurses-devel gcc",
407 5);
408#endif
409 if (avm / 1024 > rdsiz_MB * 3) {
410 if (run_program_and_log_output(command, 5)) {
411 g_tmpfs_mountpt[0] = '\0';
412 log_it("Failed to mount tmpfs");
413 } else {
414 log_it("Tmpfs mounted OK - %d MB", rdsiz_MB);
415 }
416 } else {
417 g_tmpfs_mountpt[0] = '\0';
418 log_it("It doesn't seem you have enough swap to use tmpfs. Fine.");
419 }
420 mr_free(command);
421
422 if (bkpinfo->use_lzo) {
423 strcpy(bkpinfo->zip_exe, "lzop");
424 strcpy(bkpinfo->zip_suffix, "lzo");
425 } else if (bkpinfo->use_gzip) {
426 strcpy(bkpinfo->zip_exe, "gzip");
427 strcpy(bkpinfo->zip_suffix, "gz");
428 } else if (bkpinfo->compression_level != 0) {
429 strcpy(bkpinfo->zip_exe, "bzip2");
430 strcpy(bkpinfo->zip_suffix, "bz2");
431 } else {
432 bkpinfo->zip_exe[0] = bkpinfo->zip_suffix[0] = '\0';
433 }
434
435// DVD
436
437 if (bkpinfo->backup_media_type == dvd) {
438 if (find_home_of_exe("growisofs")) {
439 mr_asprintf(&cdr_exe, "growisofs");
440 } else {
441 fatal_error("Please install growisofs.");
442 }
443 if (bkpinfo->nonbootable_backup) {
444 mr_asprintf(&mondo_mkisofs_sz, MONDO_GROWISOFS_NONBOOT);
445 } else if
446#ifdef __FreeBSD__
447 (TRUE)
448#else
449 (bkpinfo->make_cd_use_lilo)
450#endif
451#ifdef __IA64__
452 {
453 mr_asprintf(&mondo_mkisofs_sz, MONDO_GROWISOFS_REGULAR_ELILO);
454 }
455#else
456 {
457 mr_asprintf(&mondo_mkisofs_sz, MONDO_GROWISOFS_REGULAR_LILO);
458 }
459#endif
460 else
461 {
462 mr_asprintf(&mondo_mkisofs_sz, MONDO_GROWISOFS_REGULAR_SYSLINUX);
463 }
464 if (bkpinfo->manual_cd_tray) {
465 fatal_error("Manual CD tray + DVD not supported yet.");
466 // -m isn't supported by growisofs, BTW...
467 } else {
468 sprintf(bkpinfo->call_make_iso,
469 "%s %s -Z %s . 2>> _ERR_",
470 mondo_mkisofs_sz, "", bkpinfo->media_device);
471 }
472 mr_free(mondo_mkisofs_sz);
473
474 if (getenv ("SUDO_COMMAND")) {
475 mr_asprintf(&command, "strings `which growisofs` | grep -c SUDO_COMMAND");
476 if (!strcmp(call_program_and_get_last_line_of_output(command), "1")) {
477 popup_and_OK("Fatal Error: Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details.");
478 fatal_error("Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details.");
479 }
480 mr_free(command);
481 }
482 mr_msg(2, "call_make_iso (DVD res) is ... %s",
483 bkpinfo->call_make_iso);
484 } // end of DVD code
485
486// CD-R or CD-RW
487 if (bkpinfo->backup_media_type == cdrw
488 || bkpinfo->backup_media_type == cdr) {
489 if (!bkpinfo->manual_cd_tray) {
490 mr_strcat(extra_cdrom_params, "-waiti ");
491 }
492 if (bkpinfo->backup_media_type == cdrw) {
493 mr_strcat(extra_cdrom_params, "blank=fast ");
494 }
495 if (find_home_of_exe("cdrecord")) {
496 mr_asprintf(&cdr_exe, "cdrecord");
497 } else if (find_home_of_exe("dvdrecord")) {
498 mr_asprintf(&cdr_exe, "dvdrecord");
499 } else {
500 fatal_error("Please install either cdrecord or dvdrecord.");
501 }
502 if (bkpinfo->nonbootable_backup) {
503 mr_asprintf(&mondo_mkisofs_sz, MONDO_MKISOFS_NONBOOT);
504 } else if
505#ifdef __FreeBSD__
506 (TRUE)
507#else
508 (bkpinfo->make_cd_use_lilo)
509#endif
510#ifdef __IA64__
511 {
512 mr_asprintf(&mondo_mkisofs_sz, MONDO_MKISOFS_REGULAR_ELILO);
513 }
514#else
515 {
516 mr_asprintf(&mondo_mkisofs_sz, MONDO_MKISOFS_REGULAR_LILO);
517 }
518#endif
519 else
520 {
521 mr_asprintf(&mondo_mkisofs_sz, MONDO_MKISOFS_REGULAR_SYSLINUX);
522 }
523 if (bkpinfo->manual_cd_tray) {
524 if (bkpinfo->call_before_iso[0] == '\0') {
525 sprintf(bkpinfo->call_before_iso,
526 "%s -o %s/temporary.iso . 2>> _ERR_",
527 mondo_mkisofs_sz, bkpinfo->tmpdir);
528 } else {
529 mr_asprintf(&call_before_iso_user, bkpinfo->call_before_iso);
530 sprintf (bkpinfo->call_before_iso,
531 "( %s -o %s/temporary.iso . 2>> _ERR_ ; %s )",
532 mondo_mkisofs_sz, bkpinfo->tmpdir, call_before_iso_user);
533 mr_free(call_before_iso_user);
534 }
535 log_it("bkpinfo->call_before_iso = %s", bkpinfo->call_before_iso);
536 sprintf(bkpinfo->call_make_iso,
537 "%s %s -v %s fs=4m dev=%s speed=%d %s/temporary.iso",
538 cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject",
539 extra_cdrom_params, bkpinfo->media_device,
540 bkpinfo->cdrw_speed, bkpinfo->tmpdir);
541 } else {
542 sprintf(bkpinfo->call_make_iso,
543 "%s . 2>> _ERR_ | %s %s %s fs=4m dev=%s speed=%d -",
544 mondo_mkisofs_sz, cdr_exe,
545 (bkpinfo->please_dont_eject) ? " " : "-eject",
546 extra_cdrom_params, bkpinfo->media_device,
547 bkpinfo->cdrw_speed);
548 }
549 mr_free(mondo_mkisofs_sz);
550 mr_free(cdr_exe);
551 mr_free(extra_cdrom_params);
552 } // end of CD code
553
554 if (bkpinfo->backup_media_type == iso) {
555
556/* Patch by Conor Daly <conor.daly@met.ie>
557 * 23-june-2004
558 * Break up isodir into iso_mnt and iso_path
559 * These will be used along with iso-dev at restore time
560 * to locate the ISOs where ever they're mounted
561 */
562
563 log_it("isodir = %s", bkpinfo->isodir);
564 mr_asprintf(&command, "df -P %s | tail -n1 | cut -d' ' -f1",
565 bkpinfo->isodir);
566 log_it("command = %s", command);
567 mr_asprintf(&iso_dev, call_program_and_get_last_line_of_output(command));
568 mr_free(command);
569 log_it("res of it = %s", iso_dev);
570
571 fd1 = mr_fopen(MONDORESTORECFG, "a");
572 mr_fprintf(fd1, "iso-dev=%s\n", iso_dev);
573
574 mr_asprintf(&command, "mount | grep -w %s | tail -n1 | cut -d' ' -f3",
575 iso_dev);
576 mr_free(iso_dev);
577
578 log_it("command = %s", command);
579 mr_asprintf(&iso_mnt,call_program_and_get_last_line_of_output(command));
580 mr_free(command);
581
582 log_it("res of it = %s", iso_mnt);
583 mr_fprintf(fd1, "iso-mnt=%s\n", iso_mnt);
584 log_it("isomnt: %s, %d", iso_mnt, strlen(iso_mnt));
585
586 mr_asprintf(&iso_tmp, "%s", bkpinfo->isodir);
587 if (strlen(iso_tmp) >= strlen(iso_mnt)) {
588 mr_asprintf(&iso_path, "%s", iso_tmp + strlen(iso_mnt));
589 } else {
590 mr_asprintf(&iso_path, "");
591 }
592 mr_free(iso_tmp);
593 mr_free(iso_mnt);
594
595 log_it("isodir: %s", iso_path);
596 mr_fprintf(fd1, "isodir=%s\n", iso_path);
597 mr_free(iso_path);
598
599 log_it("iso-prefix: %s", bkpinfo->prefix);
600 mr_fprintf(fd1, "iso-prefix=%s\n", bkpinfo->prefix);
601
602 mr_fclose(fd1);
603 } // end of iso code
604
605 if (bkpinfo->backup_media_type == nfs) {
606 mr_asprintf(&hostname, bkpinfo->nfs_mount);
607 colon = strchr(hostname, ':');
608 if (!colon) {
609 log_it("nfs mount doesn't have a colon in it");
610 retval++;
611 } else {
612 struct hostent *hent;
613
614 *colon = '\0';
615 hent = gethostbyname(hostname);
616 if (!hent) {
617 log_it("Can't resolve NFS mount (%s): %s", hostname,
618 hstrerror(h_errno));
619 retval++;
620 } else {
621 mr_asprintf(&ip_address, "%s%s", inet_ntoa((struct in_addr)
622 *((struct in_addr *) hent->h_addr)),
623 strchr(bkpinfo->nfs_mount, ':'));
624 strcpy(bkpinfo->nfs_mount, ip_address);
625 mr_free(ip_address);
626 }
627 }
628 store_nfs_config(bkpinfo);
629 mr_free(hostname);
630 }
631
632 log_it("Finished processing incoming params");
633 if (retval) {
634 fprintf(stderr, "Type 'man mondoarchive' for help.\n");
635 }
636 mr_asprintf(&tmp, "%s", MONDO_TMPISOS);
637 if (does_file_exist(tmp)) {
638 unlink(tmp);
639 }
640 mr_free(tmp);
641
642 if (strlen(bkpinfo->tmpdir) < 2 || strlen(bkpinfo->scratchdir) < 2) {
643 log_it("tmpdir or scratchdir are blank/missing");
644 retval++;
645 }
646 if (bkpinfo->include_paths[0] == '\0') {
647 // fatal_error ("Why no backup path?");
648 strcpy(bkpinfo->include_paths, "/");
649 }
650 chmod(bkpinfo->scratchdir, 0700);
651 chmod(bkpinfo->tmpdir, 0700);
652 g_backup_media_type = bkpinfo->backup_media_type;
653 g_backup_media_string = bkpinfo->backup_media_string;
654 return (retval);
655}
656
657
658/**
659 * Do some miscellaneous setup tasks to be performed before filling @c bkpinfo.
660 * Seeds the random-number generator, loads important modules, checks the sanity
661 * of the user's Linux distribution, and deletes logfile.
662 * @param bkpinfo The backup information structure. Will be initialized.
663 * @return number of errors (0 for success)
664 */
665int pre_param_configuration(struct s_bkpinfo *bkpinfo)
666{
667 int res = 0;
668
669 make_hole_for_dir(MNT_CDROM);
670 assert(bkpinfo != NULL);
671 srandom((unsigned long) (time(NULL)));
672 insmod_crucial_modules();
673 reset_bkpinfo(bkpinfo); // also sets defaults ('/'=backup path, 3=compression level)
674 if (bkpinfo->disaster_recovery) {
675 if (!does_nonMS_partition_exist()) {
676 fatal_error
677 ("I am in disaster recovery mode\nPlease don't run mondoarchive.");
678 }
679 }
680
681 run_program_and_log_output("rm -Rf /tmp/changed.files*", FALSE);
682 }
683 res += some_basic_system_sanity_checks();
684 if (res) {
685 log_it("Your distribution did not pass Mondo's sanity test.");
686 }
687 g_current_media_number = 1;
688 bkpinfo->postnuke_tarball[0] = bkpinfo->nfs_mount[0] = '\0';
689 return (res);
690}
691
692
693
694
695/**
696 * Reset all fields of the backup information structure to a sensible default.
697 * @param bkpinfo The @c bkpinfo to reset.
698 */
699void reset_bkpinfo(struct s_bkpinfo *bkpinfo)
700{
701 int i;
702
703 mr_msg(1, "Hi");
704
705 assert(bkpinfo != NULL);
706 /* BERLIOS : Useless ?? */
707 memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
708
709 bkpinfo->manual_cd_tray = FALSE;
710 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;
711 bkpinfo->media_device[0] = '\0';
712 for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
713 bkpinfo->media_size[i] = -1;
714 }
715 bkpinfo->boot_loader = '\0';
716 bkpinfo->boot_device[0] = '\0';
717 bkpinfo->zip_exe[0] = '\0';
718 bkpinfo->zip_suffix[0] = '\0';
719 bkpinfo->restore_path[0] = '\0';
720 bkpinfo->use_lzo = FALSE;
721 bkpinfo->use_gzip = FALSE;
722 bkpinfo->do_not_compress_these[0] = '\0';
723 bkpinfo->verify_data = FALSE;
724 bkpinfo->backup_data = FALSE;
725 bkpinfo->restore_data = FALSE;
726 bkpinfo->disaster_recovery =
727 (am_I_in_disaster_recovery_mode()? TRUE : FALSE);
728 if (bkpinfo->disaster_recovery) {
729 strcpy(bkpinfo->isodir, "/");
730 } else {
731 strcpy(bkpinfo->isodir, "/var/cache/mondo/iso");
732 }
733 strcpy(bkpinfo->prefix, STD_PREFIX);
734
735 bkpinfo->scratchdir[0] = '\0';
736 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive
737 sprintf(bkpinfo->tmpdir, "/tmp/tmpfs/mondo.tmp.%d", (int) (random() % 32768)); // for mondorestore
738 bkpinfo->optimal_set_size = 0;
739 bkpinfo->backup_media_type = none;
740 bkpinfo->backup_media_string[0] = '\0';
741 strcpy(bkpinfo->include_paths, "/");
742 bkpinfo->exclude_paths[0] = '\0';
743 bkpinfo->call_before_iso[0] = '\0';
744 bkpinfo->call_make_iso[0] = '\0';
745 bkpinfo->call_burn_iso[0] = '\0';
746 bkpinfo->call_after_iso[0] = '\0';
747 bkpinfo->image_devs[0] = '\0';
748 bkpinfo->postnuke_tarball[0] = '\0';
749 bkpinfo->kernel_path[0] = '\0';
750 bkpinfo->nfs_mount[0] = '\0';
751 bkpinfo->nfs_remote_dir[0] = '\0';
752 bkpinfo->wipe_media_first = FALSE;
753 bkpinfo->differential = FALSE;
754 bkpinfo->cdrw_speed = 0;
755// patch by Herman Kuster
756 bkpinfo->differential = 0;
757// patch end
758 bkpinfo->compression_level = 3;
759}
760
761
762/**
763 * Get the remaining free space (in MB) on @p partition.
764 * @param partition The partition to check free space on (either a device or a mountpoint).
765 * @return The free space on @p partition, in MB.
766 */
767long free_space_on_given_partition(char *partition)
768{
769 char *command = NULL;
770 char *out_sz = NULL;
771 long res = 0L;
772
773 assert_string_is_neither_NULL_nor_zerolength(partition);
774
775 mr_asprintf(&command, "df -m -P %s &> /dev/null", partition);
776 if (system(command)) {
777 return (-1);
778 } // partition does not exist
779 mr_free(command);
780
781 mr_asprintf(&command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4",
782 partition);
783 mr_asprintf(&out_sz, call_program_and_get_last_line_of_output(command));
784 mr_free(command);
785
786 if (strlen(out_sz) == 0) {
787 return (-1);
788 } // error within df, probably
789 res = atol(out_sz);
790 mr_free(out_sz);
791 return (res);
792}
793
794
795/**
796 * Check the user's system for sanity. Checks performed:
797 * - make sure user has enough RAM (32mb required, 64mb recommended)
798 * - make sure user has enough free space in @c /
799 * - check kernel for ramdisk support
800 * - make sure afio, cdrecord, mkisofs, bzip2, awk, md5sum, strings, mindi, and buffer exist
801 * - make sure CD-ROM is unmounted
802 * - make sure /etc/modules.conf exists
803 * - make sure user's mountlist is OK by running <tt>mindi --makemountlist</tt>
804 *
805 * @return number of problems with the user's setup (0 for success)
806 */
807int some_basic_system_sanity_checks()
808{
809
810 /*@ buffers ************ */
811 char *tmp = NULL;
812
813 /*@ int's *************** */
814 int retval = 0;
815 long Lres;
816
817
818 mvaddstr_and_log_it(g_currentY, 0,
819 "Checking sanity of your Linux distribution");
820#ifndef __FreeBSD__
821 if (system("which mkfs.vfat &> /dev/null")
822 && !system("which mkfs.msdos &> /dev/null")) {
823 log_it
824 ("OK, you've got mkfs.msdos but not mkfs.vfat; time for the fairy to wave her magic wand...");
825 run_program_and_log_output
826 ("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE);
827 }
828 mr_asprintf(&tmp,
829 call_program_and_get_last_line_of_output
830 ("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2"));
831 if (atol(tmp) < 35000) {
832 retval++;
833 log_to_screen(_("You must have at least 32MB of RAM to use Mondo."));
834 }
835 if (atol(tmp) < 66000) {
836 log_to_screen
837 (_("WARNING! You have very little RAM. Please upgrade to 64MB or more."));
838 }
839 mr_free(tmp);
840#endif
841
842 Lres = free_space_on_given_partition("/var/cache");
843 log_it("Free space on given partition = %ld MB", Lres);
844
845 if (Lres < 50) {
846 fatal_error("Your /var/cache partition has <50MB free. Please adjust your partition table to something saner.");
847 }
848
849 if (system("which " MKE2FS_OR_NEWFS " > /dev/null 2> /dev/null")) {
850 retval++;
851 log_to_screen
852 ("Unable to find " MKE2FS_OR_NEWFS " in system path.");
853 fatal_error
854 ("Please use \"su -\", not \"su\" to become root. OK? ...and please don't e-mail the mailing list or me about this. Just read the message. :)");
855 }
856#ifndef __FreeBSD__
857 if (run_program_and_log_output
858 ("grep ramdisk /proc/devices", FALSE)) {
859 if (!ask_me_yes_or_no
860 (_("Your kernel has no ramdisk support. That's mind-numbingly stupid but I'll allow it if you're planning to use a failsafe kernel. Are you?")))
861 {
862 // retval++;
863 log_to_screen
864 (_("It looks as if your kernel lacks ramdisk and initrd support."));
865 log_to_screen
866 (_("I'll allow you to proceed but FYI, if I'm right, your kernel is broken."));
867 }
868 }
869#endif
870 retval += whine_if_not_found(MKE2FS_OR_NEWFS);
871 retval += whine_if_not_found("mkisofs");
872 if (system("which dvdrecord > /dev/null 2> /dev/null")) {
873 retval += whine_if_not_found("cdrecord");
874 }
875 retval += whine_if_not_found("bzip2");
876 retval += whine_if_not_found("gzip");
877 retval += whine_if_not_found("awk");
878 retval += whine_if_not_found("md5sum");
879 retval += whine_if_not_found("strings");
880 retval += whine_if_not_found("mindi");
881 retval += whine_if_not_found("buffer");
882
883 // abort if Windows partition but no ms-sys and parted
884 if (!run_program_and_log_output
885 ("mount | grep -w vfat | grep -vE \"/dev/fd|nexdisk\"", 0)
886 ||
887 !run_program_and_log_output
888 ("mount | grep -w dos | grep -vE \"/dev/fd|nexdisk\"", 0)) {
889 log_to_screen(_("I think you have a Windows 9x partition."));
890 retval += whine_if_not_found("parted");
891#ifndef __IA64__
892 /* IA64 always has one vfat partition for EFI even without Windows */
893 // retval +=
894 if (!find_home_of_exe("ms-sys")) {
895 log_to_screen("Please install ms-sys just in case.");
896 }
897#endif
898 }
899
900 if (!find_home_of_exe("cmp")) {
901 if (!find_home_of_exe("true")) {
902 whine_if_not_found("cmp");
903 } else {
904 log_to_screen
905 ("Your system lacks the 'cmp' binary. I'll create a dummy cmp for you.");
906 if (run_program_and_log_output
907 ("cp -f `which true` /usr/bin/cmp", 0)) {
908 fatal_error("Failed to create dummy 'cmp' file.");
909 }
910 }
911 }
912 run_program_and_log_output
913 ("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5);
914 mr_asprintf(&tmp,
915 call_program_and_get_last_line_of_output
916 ("mount | grep -E \"cdr(om|w)\""));
917 if (strcmp("", tmp)) {
918 if (strstr(tmp, "autofs")) {
919 log_to_screen
920 (_("Your CD-ROM is mounted via autofs. I therefore cannot tell"));
921 log_to_screen
922 (_("if a CD actually is inserted. If a CD is inserted, please"));
923 log_to_screen(_("eject it. Thank you."));
924 log_it
925 ("Ignoring autofs CD-ROM 'mount' since we hope nothing's in it.");
926 } else
927 if (run_program_and_log_output("uname -a | grep Knoppix", 5)) {
928 retval++;
929 fatal_error
930 ("Your CD-ROM drive is mounted. Please unmount it.");
931 }
932 }
933 mr_free(tmp);
934#ifndef __FreeBSD__
935 if (!does_file_exist("/etc/modules.conf")) {
936 if (does_file_exist("/etc/conf.modules")) {
937 log_it("Linking /etc/modules.conf to /etc/conf.modules");
938 run_program_and_log_output
939 ("ln -sf /etc/conf.modules /etc/modules.conf", 5);
940 } else if (does_file_exist("/etc/modprobe.d")) {
941 log_it
942 ("Directory /etc/modprobe.d found. mindi will use its contents.");
943 } else if (does_file_exist("/etc/modprobe.conf")) {
944 log_it("Linking /etc/modules.conf to /etc/modprobe.conf");
945 run_program_and_log_output
946 ("ln -sf /etc/modprobe.conf /etc/modules.conf", 5);
947 } else {
948 retval++;
949 log_to_screen
950 (_("Please find out what happened to /etc/modules.conf"));
951 }
952 }
953#endif
954
955 run_program_and_log_output("cat /etc/fstab", 5);
956#ifdef __FreeBSD__
957 run_program_and_log_output("vinum printconfig", 5);
958#else
959 run_program_and_log_output("cat /etc/raidtab", 5);
960#endif
961
962 if (run_program_and_log_output("mindi -V", 1)) {
963 log_to_screen(_("Could not ascertain mindi's version number."));
964 log_to_screen
965 (_("You have not installed Mondo and/or Mindi properly."));
966 log_to_screen(_("Please uninstall and reinstall them both."));
967 fatal_error("Please reinstall Mondo and Mindi.");
968 }
969 if (run_program_and_log_output
970 ("mindi --makemountlist /tmp/mountlist.txt.test", 5)) {
971 log_to_screen
972 (_("Mindi --makemountlist /tmp/mountlist.txt.test failed for some reason."));
973 log_to_screen
974 (_("Please run that command by hand and examine /var/log/mindi.log"));
975 log_to_screen
976 (_("for more information. Perhaps your /etc/fstab file is insane."));
977 log_to_screen
978 (_("Perhaps Mindi's MakeMountlist() subroutine has a bug. We'll see."));
979 retval++;
980 }
981
982 if (!run_program_and_log_output("parted2fdisk -l | grep -i raid", 1)
983 && !does_file_exist("/etc/raidtab")) {
984 log_to_screen
985 (_("You have RAID partitions but no /etc/raidtab - creating one from /proc/mdstat"));
986 create_raidtab_from_mdstat("/etc/raidtab");
987 }
988
989 if (retval) {
990 mvaddstr_and_log_it(g_currentY++, 74, _("Failed."));
991 } else {
992 mvaddstr_and_log_it(g_currentY++, 74, _("Done."));
993 }
994 return (retval);
995}
996
997/**
998 * Retrieve the line containing @p label from the config file.
999 * @param config_file The file to read from, usually @c /tmp/mondo-restore.cfg.
1000 * @param label What to read from the file.
1001 * @param value Where to put it.
1002 * @return 0 for success, 1 for failure.
1003 */
1004int read_cfg_var(char *config_file, char *label, char *value)
1005{
1006 /*@ buffer ****************************************************** */
1007 char *command = NULL;
1008 char *tmp = NULL;
1009
1010 /*@ end vars *************************************************** */
1011
1012 assert_string_is_neither_NULL_nor_zerolength(config_file);
1013 assert_string_is_neither_NULL_nor_zerolength(label);
1014
1015 if (!does_file_exist(config_file)) {
1016 mr_asprintf(&tmp, "(read_cfg_var) Cannot find %s config file",
1017 config_file);
1018 log_to_screen(tmp);
1019 mr_free(tmp);
1020 value[0] = '\0';
1021 return (1);
1022 /* } BERLIOS: Useless:
1023 else if (strstr(value, "/dev/") && strstr(value, "t0")
1024 && !strcmp(label, "media-dev")) {
1025 mr_msg(2, "FYI, I shan't read new value for %s - already got %s",
1026 label, value);
1027 return (0);
1028 */ } else {
1029 mr_asprintf(&command, "grep '%s .*' %s| cut -d'=' -f2,3,4,5",
1030 label, config_file);
1031 strcpy(value, call_program_and_get_last_line_of_output(command));
1032 mr_free(command);
1033 if (strlen(value) == 0) {
1034 return (1);
1035 } else {
1036 return (0);
1037 }
1038 }
1039}
1040
1041
1042/**
1043 * Remount @c supermount if it was unmounted earlier.
1044 */
1045void remount_supermounts_if_necessary()
1046{
1047 if (g_remount_cdrom_at_end) {
1048 run_program_and_log_output("mount " MNT_CDROM, FALSE);
1049 }
1050 if (g_remount_floppy_at_end) {
1051 run_program_and_log_output("mount " MNT_FLOPPY, FALSE);
1052 }
1053}
1054
1055/**
1056 * Unmount @c supermount if it's mounted.
1057 */
1058void unmount_supermounts_if_necessary()
1059{
1060 if (run_program_and_log_output
1061 ("mount | grep cdrom | grep super", FALSE) == 0) {
1062 g_remount_cdrom_at_end = TRUE;
1063 run_program_and_log_output("umount " MNT_CDROM, FALSE);
1064 }
1065 if (run_program_and_log_output
1066 ("mount | grep floppy | grep super", FALSE) == 0) {
1067 g_remount_floppy_at_end = TRUE;
1068 run_program_and_log_output("umount " MNT_FLOPPY, FALSE);
1069 }
1070}
1071
1072/**
1073 * If this is a distribution like Gentoo that doesn't keep /boot mounted, mount it.
1074 */
1075void mount_boot_if_necessary()
1076{
1077 char *tmp = NULL;
1078 char *tmp1 = NULL;
1079 char *command = NULL;
1080
1081 mr_msg(1, "Started sub");
1082 mr_msg(4, "About to set g_boot_mountpt[0] to '\\0'");
1083 g_boot_mountpt[0] = '\0';
1084 mr_msg(4, "Done. Great. Setting command to something");
1085 mr_asprintf(&command,
1086 "grep -v ':' /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
1087 mr_msg(4, "Cool. Command = '%s'", command);
1088 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command));
1089 mr_free(command);
1090
1091 mr_msg(4, "tmp = '%s'", tmp);
1092 if (tmp[0]) {
1093 log_it("/boot is at %s according to /etc/fstab", tmp);
1094 if (strstr(tmp, "LABEL=")) {
1095 if (!run_program_and_log_output("mount /boot", 5)) {
1096 strcpy(g_boot_mountpt, "/boot");
1097 mr_msg(1, "Mounted /boot");
1098 } else {
1099 log_it("...ignored cos it's a label :-)");
1100 }
1101 } else {
1102 mr_asprintf(&command, "mount | grep -E '^%s'", tmp);
1103 mr_msg(3, "command = %s", command);
1104 if (run_program_and_log_output(command, 5)) {
1105 strcpy(g_boot_mountpt, tmp);
1106 mr_asprintf(&tmp1,
1107 "%s (your /boot partition) is not mounted. I'll mount it before backing up",
1108 g_boot_mountpt);
1109 log_it(tmp1);
1110 mr_free(tmp1);
1111
1112 mr_asprintf(&tmp1, "mount %s", g_boot_mountpt);
1113 if (run_program_and_log_output(tmp1, 5)) {
1114 g_boot_mountpt[0] = '\0';
1115 mr_msg(1, "Plan B");
1116 if (!run_program_and_log_output("mount /boot", 5)) {
1117 strcpy(g_boot_mountpt, "/boot");
1118 mr_msg(1, "Plan B worked");
1119 } else {
1120 mr_msg(1,
1121 "Plan B failed. Unable to mount /boot for backup purposes. This probably means /boot is mounted already, or doesn't have its own partition.");
1122 }
1123 }
1124 mr_free(tmp1);
1125 }
1126 mr_free(command);
1127 }
1128 }
1129 mr_free(tmp);
1130 mr_msg(1, "Ended sub");
1131}
1132
1133
1134/**
1135 * If we mounted /boot earlier, unmount it.
1136 */
1137void unmount_boot_if_necessary()
1138{
1139 char *tmp;
1140
1141 mr_msg(3, "starting");
1142 if (g_boot_mountpt[0]) {
1143 mr_asprintf(&tmp, "umount %s", g_boot_mountpt);
1144 if (run_program_and_log_output(tmp, 5)) {
1145 log_it("WARNING - unable to unmount /boot");
1146 }
1147 mr_free(tmp);
1148 }
1149 mr_msg(3, "leaving");
1150}
1151
1152
1153/**
1154 * Write a line to a configuration file. Writes a line of the form,
1155 * @c label @c value.
1156 * @param config_file The file to write to. Usually @c mondo-restore.cfg.
1157 * @param label What to call this bit of data you're writing.
1158 * @param value The bit of data you're writing.
1159 * @return 0 for success, 1 for failure.
1160 */
1161int write_cfg_var(char *config_file, char *label, char *value)
1162{
1163 /*@ buffers ***************************************************** */
1164 char *command = NULL;
1165 char *tempfile = NULL;
1166 char *tmp = NULL;
1167
1168
1169 /*@ end vars *************************************************** */
1170 assert_string_is_neither_NULL_nor_zerolength(config_file);
1171 assert_string_is_neither_NULL_nor_zerolength(label);
1172 assert(value != NULL);
1173
1174 if (!does_file_exist(config_file)) {
1175 mr_asprintf(&tmp, "(write_cfg_file) Cannot find %s config file",
1176 config_file);
1177 log_to_screen(tmp);
1178 mr_free(tmp);
1179 return (1);
1180 }
1181 mr_asprintf(&tempfile,
1182 call_program_and_get_last_line_of_output
1183 ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX"));
1184 if (does_file_exist(config_file)) {
1185 mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s",
1186 label, config_file, tempfile);
1187 paranoid_system(command);
1188 mr_free(command);
1189 }
1190 mr_asprintf(&command, "echo \"%s %s\" >> %s", label, value, tempfile);
1191 paranoid_system(command);
1192 mr_free(command);
1193
1194 mr_asprintf(&command, "mv -f %s %s", tempfile, config_file);
1195 paranoid_system(command);
1196 mr_free(command);
1197 unlink(tempfile);
1198 mr_free(tempfile);
1199 return (0);
1200}
1201
1202
1203/**
1204 * Allocate or free important globals, depending on @p mal.
1205 * @param mal If TRUE, malloc; if FALSE, free.
1206 */
1207void do_libmondo_global_strings_thing(int mal)
1208{
1209 if (mal) {
1210 iamhere("Malloc'ing globals");
1211 malloc_string(g_boot_mountpt);
1212 malloc_string(g_tmpfs_mountpt);
1213 malloc_string(g_erase_tmpdir_and_scratchdir);
1214 malloc_string(g_serial_string);
1215 malloc_string(g_magicdev_command);
1216 } else {
1217 iamhere("Freeing globals");
1218 mr_free(g_boot_mountpt);
1219 mr_free(g_tmpfs_mountpt);
1220 mr_free(g_erase_tmpdir_and_scratchdir);
1221 mr_free(g_serial_string);
1222 mr_free(g_magicdev_command);
1223 }
1224}
1225
1226/**
1227 * Allocate important globals.
1228 * @see do_libmondo_global_strings_thing
1229 */
1230void malloc_libmondo_global_strings(void)
1231{
1232 do_libmondo_global_strings_thing(1);
1233}
1234
1235/**
1236 * Free important globals.
1237 * @see do_libmondo_global_strings_thing
1238 */
1239void free_libmondo_global_strings(void)
1240{
1241 do_libmondo_global_strings_thing(0);
1242}
1243
1244
1245
1246/**
1247 * Stop @c magicdev if it's running.
1248 * The command used to start it is saved in @p g_magicdev_command.
1249 */
1250void stop_magicdev_if_necessary()
1251{
1252 strcpy(g_magicdev_command,
1253 call_program_and_get_last_line_of_output
1254 ("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99"));
1255 if (g_magicdev_command[0]) {
1256 mr_msg(1, "g_magicdev_command = '%s'", g_magicdev_command);
1257 paranoid_system("killall magicdev");
1258 }
1259}
1260
1261
1262/**
1263 * Restart magicdev if it was stopped.
1264 */
1265void restart_magicdev_if_necessary()
1266{
1267 char *tmp = NULL;
1268
1269 if (g_magicdev_command && g_magicdev_command[0]) {
1270 mr_asprintf(&tmp, "%s &", g_magicdev_command);
1271 paranoid_system(tmp);
1272 mr_free(tmp);
1273 }
1274}
1275
1276/* @} - end of utilityGroup */
Note: See TracBrowser for help on using the repository browser.