"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/prog.c" between
burp-2.3.14.tar.bz2 and burp-2.3.20.tar.bz2

About: Burp is a backup and restore program using librsync and also VSS (for Windows clients). Latest version.

prog.c  (burp-2.3.14.tar.bz2):prog.c  (burp-2.3.20.tar.bz2)
skipping to change at line 58 skipping to change at line 58
printf("\n"); printf("\n");
printf(" Options:\n"); printf(" Options:\n");
printf(" -a <action> The action can be one of the following.\n"); printf(" -a <action> The action can be one of the following.\n");
printf(" b: backup\n"); printf(" b: backup\n");
printf(" delete: delete\n"); printf(" delete: delete\n");
printf(" d: diff\n"); printf(" d: diff\n");
printf(" e: estimate\n"); printf(" e: estimate\n");
printf(" l: list (this is the default when an action is not given)\n"); printf(" l: list (this is the default when an action is not given)\n");
printf(" L: long list\n"); printf(" L: long list\n");
printf(" m: monitor interface\n"); printf(" m: monitor interface\n");
printf(" p: parseable list\n");
printf(" r: restore\n"); printf(" r: restore\n");
printf(" R: Restore (matching ordered paths on stdin)\n" );
#ifndef HAVE_WIN32 #ifndef HAVE_WIN32
printf(" s: status monitor (ncurses)\n"); printf(" s: status monitor (ncurses)\n");
printf(" S: status monitor snapshot\n"); printf(" S: status monitor snapshot\n");
#endif #endif
printf(" t: timed backup\n"); printf(" t: timed backup\n");
printf(" T: check backup timer, but do not actually back up\n"); printf(" T: check backup timer, but do not actually back up\n");
printf(" v: verify\n"); printf(" v: verify\n");
printf(" V: Verify (matching ordered paths on stdin)\n") ;
printf(" -b <number> Backup number (default: the most recent backup). \n"); printf(" -b <number> Backup number (default: the most recent backup). \n");
printf(" -c <path> Path to conf file (default: %s).\n", config_defa ult_path()); printf(" -c <path> Path to conf file (default: %s).\n", config_defa ult_path());
printf(" -d <directory> Directory to restore to, or directory to list.\n "); printf(" -d <directory> Directory to restore to, or directory to list.\n ");
printf(" -o <option> Override a given configuration option (you can u se this flag several times).\n"); printf(" -o <option> Override a given configuration option (you can u se this flag several times).\n");
printf(" -f Allow overwrite during restore.\n"); printf(" -f Allow overwrite during restore.\n");
printf(" -h|-? Print this text and exit.\n"); printf(" -h|-? Print this text and exit.\n");
printf(" -i Print index of symbols and exit.\n"); printf(" -i Print index of symbols and exit.\n");
printf(" -q <max secs> Randomised delay of starting a timed backup.\n") ; printf(" -q <max secs> Randomised delay of starting a timed backup.\n") ;
printf(" -Q Do not log to stdout\n"); printf(" -Q Do not log to stdout\n");
printf(" -r <regex> Specify a regular expression.\n"); printf(" -r <regex> Specify a regular expression.\n");
skipping to change at line 144 skipping to change at line 147
if(!newval) return 0; if(!newval) return 0;
return set_string(conf, newval); return set_string(conf, newval);
} }
static void usage(void) static void usage(void)
{ {
usage_server(); usage_server();
usage_client(); usage_client();
} }
static int parse_action(enum action *act, const char *optarg) static int parse_action(enum action *act, const char *optarg,
struct strlist **cli_overrides)
{ {
if(!strncmp(optarg, "backup", 1)) if(!strncmp(optarg, "backup", 1))
*act=ACTION_BACKUP; *act=ACTION_BACKUP;
else if(!strncmp(optarg, "timedbackup", 1)) else if(!strncmp(optarg, "timedbackup", 1))
*act=ACTION_BACKUP_TIMED; *act=ACTION_BACKUP_TIMED;
else if(!strncmp(optarg, "Timercheck", 1)) else if(!strncmp(optarg, "Timercheck", 1))
*act=ACTION_TIMER_CHECK; *act=ACTION_TIMER_CHECK;
else if(!strncmp(optarg, "restore", 1)) else if(!strncmp(optarg, "restore", 1))
*act=ACTION_RESTORE; *act=ACTION_RESTORE;
else if(!strncmp(optarg, "Restore", 1))
{
*act=ACTION_RESTORE;
strlist_add(cli_overrides, "restore_list=/dev/stdin", 0);
}
else if(!strncmp(optarg, "verify", 1)) else if(!strncmp(optarg, "verify", 1))
*act=ACTION_VERIFY; *act=ACTION_VERIFY;
else if(!strncmp(optarg, "Verify", 1))
{
*act=ACTION_VERIFY;
strlist_add(cli_overrides, "restore_list=/dev/stdin", 0);
}
else if(!strncmp(optarg, "list", 1)) else if(!strncmp(optarg, "list", 1))
*act=ACTION_LIST; *act=ACTION_LIST;
else if(!strncmp(optarg, "List", 1)) else if(!strncmp(optarg, "List", 1))
*act=ACTION_LIST_LONG; *act=ACTION_LIST_LONG;
else if(!strncmp(optarg, "parseablelist", 1))
*act=ACTION_LIST_PARSEABLE;
else if(!strncmp(optarg, "status", 1)) else if(!strncmp(optarg, "status", 1))
*act=ACTION_STATUS; *act=ACTION_STATUS;
else if(!strncmp(optarg, "Status", 1)) else if(!strncmp(optarg, "Status", 1))
*act=ACTION_STATUS_SNAPSHOT; *act=ACTION_STATUS_SNAPSHOT;
else if(!strncmp(optarg, "estimate", 1)) else if(!strncmp(optarg, "estimate", 1))
*act=ACTION_ESTIMATE; *act=ACTION_ESTIMATE;
// Make them spell 'delete' out fully so that it is less likely to be // Make them spell 'delete' out fully so that it is less likely to be
// used accidently. // used accidently.
else if(!strncmp_w(optarg, "delete")) else if(!strncmp_w(optarg, "delete"))
*act=ACTION_DELETE; *act=ACTION_DELETE;
skipping to change at line 311 skipping to change at line 327
const char *logfile=NULL; const char *logfile=NULL;
// The orig_client is the original client that the normal client // The orig_client is the original client that the normal client
// would like to restore from. // would like to restore from.
#ifndef HAVE_WIN32 #ifndef HAVE_WIN32
int generate_ca_only=0; int generate_ca_only=0;
#endif #endif
enum vss_restore vss_restore=VSS_RESTORE_ON; enum vss_restore vss_restore=VSS_RESTORE_ON;
int test_confs=0; int test_confs=0;
enum burp_mode mode; enum burp_mode mode;
struct strlist *cli_overrides=NULL; struct strlist *cli_overrides=NULL;
int keep_readall_caps=0;
log_init(argv[0]); log_init(argv[0]);
#ifndef HAVE_WIN32 #ifndef HAVE_WIN32
if(!strcmp(prog, "bedup")) if(!strcmp(prog, "bedup"))
return run_bedup(argc, argv); return run_bedup(argc, argv);
if(!strcmp(prog, "bsigs")) if(!strcmp(prog, "bsigs"))
return run_bsigs(argc, argv); return run_bsigs(argc, argv);
if(!strcmp(prog, "bsparse")) if(!strcmp(prog, "bsparse"))
return run_bsparse(argc, argv); return run_bsparse(argc, argv);
#endif #endif
while((option=getopt(argc, argv, "a:b:C:c:d:o:Ffghijl:nQq:r:s:tVvXxz:?")) !=-1) while((option=getopt(argc, argv, "a:b:C:c:d:o:Ffghijl:nQq:r:s:tVvXxz:?")) !=-1)
{ {
switch(option) switch(option)
{ {
case 'a': case 'a':
if(parse_action(&act, optarg)) goto end; if(parse_action(&act, optarg,
&cli_overrides)) goto end;
break; break;
case 'b': case 'b':
// The diff command may have two backups // The diff command may have two backups
// specified. // specified.
if(!backup2 && backup) backup2=optarg; if(!backup2 && backup) backup2=optarg;
if(!backup) backup=optarg; if(!backup) backup=optarg;
break; break;
case 'C': case 'C':
orig_client=optarg; orig_client=optarg;
break; break;
skipping to change at line 423 skipping to change at line 441
if(act==ACTION_MONITOR) if(act==ACTION_MONITOR)
{ {
// Try to output everything in JSON. // Try to output everything in JSON.
log_set_json(1); log_set_json(1);
// Need to do this so that processes reading stdout get the // Need to do this so that processes reading stdout get the
// result of the printfs of logp straight away. // result of the printfs of logp straight away.
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
} }
if(act==ACTION_LIST_PARSEABLE)
strlist_add(&cli_overrides, "stdout=0", 0);
conf_set_cli_overrides(cli_overrides); conf_set_cli_overrides(cli_overrides);
if(!(confs=confs_alloc())) if(!(confs=confs_alloc()))
goto end; goto end;
if(reload(confs, conffile, 1)) if(reload(confs, conffile, 1))
goto end; goto end;
// Dry run to test config file syntax. // Dry run to test config file syntax.
if(test_confs) if(test_confs)
{ {
skipping to change at line 501 skipping to change at line 522
} }
} }
else if(mode==BURP_MODE_CLIENT) else if(mode==BURP_MODE_CLIENT)
{ {
set_int(confs[OPT_VSS_RESTORE], vss_restore); set_int(confs[OPT_VSS_RESTORE], vss_restore);
switch(act) switch(act)
{ {
case ACTION_BACKUP: case ACTION_BACKUP:
case ACTION_BACKUP_TIMED: case ACTION_BACKUP_TIMED:
case ACTION_TIMER_CHECK: case ACTION_TIMER_CHECK:
#ifdef ENABLE_KEEP_READALL_CAPS_SUPPORT
keep_readall_caps=get_int(confs[OPT_READALL]);
// readall=1 cannot work with atime=0 (O_NOATIME)
if (keep_readall_caps)
set_int(confs[OPT_ATIME], 1);
#endif
// Need to get the lock. // Need to get the lock.
if(!(lock=get_prog_lock(confs))) if(!(lock=get_prog_lock(confs)))
goto end; goto end;
break; break;
default: default:
break; break;
} }
} }
// Change privileges after having got the lock, for convenience. // Change privileges after having got the lock, for convenience.
if(chuser_and_or_chgrp( if(chuser_and_or_chgrp(
get_string(confs[OPT_USER]), get_string(confs[OPT_GROUP]))) get_string(confs[OPT_USER]), get_string(confs[OPT_GROUP]),
keep_readall_caps))
return -1; return -1;
set_int(confs[OPT_OVERWRITE], forceoverwrite); set_int(confs[OPT_OVERWRITE], forceoverwrite);
set_int(confs[OPT_STRIP], strip); set_int(confs[OPT_STRIP], strip);
set_int(confs[OPT_FORK], forking); set_int(confs[OPT_FORK], forking);
set_int(confs[OPT_DAEMON], daemon); set_int(confs[OPT_DAEMON], daemon);
strip_trailing_slashes(&restoreprefix); strip_trailing_slashes(&restoreprefix);
strip_trailing_slashes(&browsedir); strip_trailing_slashes(&browsedir);
if(replace_conf_str(confs[OPT_BACKUP], backup) if(replace_conf_str(confs[OPT_BACKUP], backup)
 End of changes. 12 change blocks. 
3 lines changed or deleted 31 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)