Changeset 1080 in MondoRescue for branches/stable/mondo/src/mondoarchive
- Timestamp:
- Jan 28, 2007, 7:04:41 PM (17 years ago)
- Location:
- branches/stable/mondo/src/mondoarchive
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondoarchive/main.c
r1067 r1080 1 1 /*************************************************************************** 2 main.c - description 3 ------------------- 4 begin : Fri Apr 19 16:40:35 EDT 2002 5 copyright : (C) 2002 by Stan Benoit 6 email : troff@nakedsoul.org 7 cvsid : $Id$ 8 ***************************************************************************/ 9 10 /*************************************************************************** 11 * * 12 * This program is free software; you can redistribute it and/or modify * 13 * it under the terms of the GNU General Public License as published by * 14 * the Free Software Foundation; either version 2 of the License, or * 15 * (at your option) any later version. * 16 * * 17 ***************************************************************************/ 18 19 /** change log ****** MONDO-DEVEL 20 21 22 12/10 23 - disable stopping/starting of autofs 24 25 10/01 26 - update g_erase_tmpdir_and_scratchdir to delete user-specified tmpdir, scratchdir 27 28 06/19 29 - added AUX_VER 30 31 06/14/2004 32 - use mondorescue.iso, not mindi.iso 33 34 02/10/2004 35 - tell users where BusyBox's sources are 36 37 11/14/2003 38 - cleaned up logging at end# 39 40 10/23 41 - don't try to test-read tape ... That's already 42 handled by post_param_configuration() 43 44 10/19 45 - if your PATH var is too long, abort 46 47 09/23 48 - added some comments 49 - malloc/free global strings in new subroutines - malloc_libmondo_global_strings() 50 and free_libmondo_global_strings() - which are in libmondo-tools.c 51 - better magicdev support 52 53 54 09/16 55 - delete /var/log/partimagehack-debug.log at start of main() 56 57 09/15 58 - added askbootloader 59 60 09/09 61 - if your tape is weird, I'll pause between backup and verify 62 - fixed silly bug in main() - re: say_at_end 63 64 01/01 - 08/31 65 - call 'dmesg -n1' at start, to shut the kernel logger up 66 - moved g_erase_tmpdir_and_scratchdir to common/newt-specific.c 67 - added 'don't panic' msg to start of logfile 68 - added 'nice(20)' to main() 69 - added lots of assert()'s and log_OS_error()'s 70 - clean-up (Hugo) 71 - make post_param_configuration() setup g_erase_tmpdir_and_scratchdir 72 - if --version then print & exit quickly 73 - re-run g_erase_tmpdir_and_scratchdir via system() at very end 74 75 Year: 2002 76 - if user goes root with 'su' instead of 'su -' then 77 workaround it by setting PATH correctly 78 - wipe mondoarchive.log at very beginning 79 - cleaned up code 80 - if changed.files.N exists then copy to changes.files for display 81 - run_program_and_log_output() now takes boolean operator to specify 82 whether it will log its activities in the event of _success_ 83 - added popup list of changed files 84 - removed 'beta-quality' warnings 85 - if kernel not found and mondo in graphics mode then popup and ask 86 for kernel path+filename 87 - fixed tmp[] 'too small' bug 88 - unmount and eject CD at end of verify cycle 89 - moved interactively_obtain...() to libmondo-stream.c 90 - wrote stuff to autodetect tape+cdrw+etc. 91 - renamed from main.c to mondo-archive.c 92 - fore+after warnings that this code is beta-quality 93 - abort if running from ramdisk 94 - remount floppy at end & unmount at start if Mandrake 95 - took out #debug stuff 96 - add 2> /dev/null to 'find' command 97 - add support for bkpinfo->nonbootable_backup 98 - add main function begin comment and debug conditional 99 compilation - Stan Benoit 100 - add debug statements to build a run tree. Stan Benoit 101 **** end change log **********/ 2 * $Id$ 3 */ 102 4 103 5 … … 286 188 say_at_end[0] = '\0'; 287 189 printf("Initializing...\n"); 288 if (!(bkpinfo = malloc(sizeof(struct s_bkpinfo)))) { 289 fatal_error("Cannot malloc bkpinfo"); 290 } 190 bkpinfo = mr_malloc(sizeof(struct s_bkpinfo)); 291 191 292 192 /* initialize log file with time stamp */ … … 538 438 system(g_erase_tmpdir_and_scratchdir); 539 439 free_libmondo_global_strings(); 540 paranoid_free(say_at_end);541 paranoid_free(tmp);542 paranoid_free(bkpinfo);440 mr_free(say_at_end); 441 mr_free(tmp); 442 mr_free(bkpinfo); 543 443 544 444 unlink("/tmp/filelist.full"); -
branches/stable/mondo/src/mondoarchive/mondo-cli.c
r1067 r1080 1 1 /*************************************************************************** 2 mondo-cli.c 3 ------------------- 4 begin : Fri Apr 19 16:40:35 EDT 2002 5 copyright : (C) 2002 Mondo Hugo Rabson 6 email : Hugo Rabson <hugorabson@msn.com> 7 edited by : by Stan Benoit 4/2002 8 email : troff@nakedsoul.org 9 cvsid : $Id$ 10 ***************************************************************************/ 11 12 /*************************************************************************** 13 * * 14 * This program is free software; you can redistribute it and/or modify * 15 * it under the terms of the GNU General Public License as published by * 16 * the Free Software Foundation; either version 2 of the License, or * 17 * (at your option) any later version. * 18 * * 19 ***************************************************************************/ 20 21 /*************************************************************************** 22 UPDATE LOG 23 24 25 08/04 26 - if user specifies a dumb -T value, abort 27 28 07/22 29 - handle -Q sensibly (don't abort if only -Q supplied) 30 31 07/17 32 - better checking of NFS dir's validity 33 34 06/19 35 - added AUX_VER 36 37 04/17 38 - added '-b' support 39 04/03 40 - added star support 41 42 02/06 43 - fixed "Please give /dev entry" error msg 44 45 01/20/2004 46 - added 2.6.x-kernel "device = /dev/...." support to param reader 47 - better handling of SCSI and /dev entries 48 - touch /boot/boot.b if necessary 49 50 09/26/2003 51 - typo in command-line handling of 'r' 52 53 09/25 54 - added DVD write support 55 56 09/24 57 - if tape backup (-t) but user doesn't specify tape drive then 58 make an educated guess using find_tape_device_and_size() 59 60 09/18 61 - insist on partimagehack being present if -x found 62 63 09/16 64 - added support for multiple -I's and -E's in call to mondoarchive 65 - the '-D' flag doesn't take a value now 66 67 07/14 68 - fatal error if -E too short 69 70 05/14 71 - if 'n' and user doesn't have rights to write to output dir 72 then error out 73 74 05/05 75 - added Joshua Oreman's FreeBSD patches 76 77 05/04 78 - added Herman Kuster's multi-level bkp patch 79 80 05/02 81 - write errors to screen, not just to log 82 83 04/25 84 - added lots of assert()'s and log_OS_error()'s 85 86 04/21 87 - line 570 --- resolve boot device if softlink 88 89 04/08 90 - changed a bunch of fprintf(stderr,...)'s to log_it()'s 91 - fixed final / removal in retrieve_switches_from_command_line() 92 93 04/04 94 - added -e 95 96 03/15 97 - reject relative paths if -d flag (Alessandro Polverini) 98 99 01/02/2003 100 - added -J flag (to let user specify incoming filelist) 101 102 12/13/2002 103 - various strcpy() calls replaced with strncpy() calls 104 105 12/10 106 - added g_loglevel 107 108 11/25 109 - line 614 --- if commmand-line param ends in '/' then drop that '/' 110 111 11/19 112 - rewrote finish() to kill processes more softly 113 - if user calls with '-l RAW' then 114 115 09/01 - 09/30 116 - added -N to let user exclude all NFS-related mounts and devices 117 - run_program_and_log_output() now takes boolean operator to specify 118 whether it will log its activities in the event of _success_ 119 120 08/01 - 08/31 121 - if no device specified when backing up to tape streamer then assume /dev/st0 122 - abort if tape user specifies tape size (just for testing porpoises) 123 - tape users no longer need to specify tape size 124 - added some comments 125 - added bkpinfo->backup_media_type 126 - renamed from mondo-archive.c to mondo-cli.c 127 128 07/01 - 07/31 129 - better check for mkfs.vfat 130 - more sanity-checking for -d flag 131 - if isodir does not exist then abort 132 - removed "the rest are..." comment from log 133 - do not permit '-H' and '-t' in the same command line 134 - if not '-o' then insist on vfat-friendly kernel 135 136 06/01 - 06/30 137 - added signal-trapping 138 - added '-W' (won't make bootable CD or floppies) flag 139 - added missing 'j++' to -s switch's code 140 - expanded -s switch 141 - added -u switch 142 - if dvdrecord exists and cdrecord doesn't then use 143 dvdrecord instead of cdrecord 144 145 04/01 - 04/30 146 - if CD-ROM is supermounted then unmount, run, and remount 147 - replace MONDO_VERSION #define with VERSION from ../config.h 148 - if CD-ROM is mounted at start then abort 149 - improved homedir-locating code 150 - improved "backup will occupy N CD's" calculation a bit 151 - added -m (manual CD tray) flag 152 153 2 $Id$ 154 3 *******************************************************************/ 155 4 … … 166 15 #include "mondo-cli-EXT.h" 167 16 #include "../common/libmondo.h" 17 #include "mr_mem.h" 168 18 169 19 //static char cvsid[] = "$Id$"; … … 282 132 store_nfs_config(bkpinfo); 283 133 } 284 paranoid_free(tmp);134 mr_free(tmp); 285 135 return (retval); 286 136 } … … 440 290 strcat(bkpinfo->include_paths, " "); 441 291 } 442 asprintf(&tmp1, flag_val['I']);292 mr_asprintf(&tmp1, flag_val['I']); 443 293 p = tmp1; 444 294 q = tmp1; … … 462 312 } 463 313 } 464 paranoid_free(tmp1);314 mr_free(tmp1); 465 315 466 316 strncpy(bkpinfo->include_paths + strlen(bkpinfo->include_paths), … … 684 534 if (flag_set['z']) { 685 535 if (find_home_of_exe("getfattr")) { 686 asprintf(&g_getfattr,"getfattr");536 mr_asprintf(&g_getfattr,"getfattr"); 687 537 } 688 538 if (find_home_of_exe("getfacl")) { 689 asprintf(&g_getfacl,"getfacl");539 mr_asprintf(&g_getfacl,"getfacl"); 690 540 } 691 541 } … … 700 550 strcat(bkpinfo->exclude_paths, " "); 701 551 } 702 asprintf(&tmp1, flag_val['E']);552 mr_asprintf(&tmp1, flag_val['E']); 703 553 p = tmp1; 704 554 q = tmp1; … … 728 578 } 729 579 } 730 paranoid_free(tmp1);580 mr_free(tmp1); 731 581 732 582 strncpy(bkpinfo->exclude_paths + strlen(bkpinfo->exclude_paths), … … 1005 855 /* and finally... */ 1006 856 1007 paranoid_free(tmp);1008 paranoid_free(psz);857 mr_free(tmp); 858 mr_free(psz); 1009 859 return (retval); 1010 860 }
Note:
See TracChangeset
for help on using the changeset viewer.