int am_root = 0; /* 0 = normal, 1 = root, 2 = --super, -1 = --fake-super */
int am_server = 0;
int am_sender = 0;
-int am_generator = 0;
int am_starting_up = 1;
int relative_paths = -1;
int implied_dirs = 1;
int allow_8bit_chars = 0;
int force_delete = 0;
int io_timeout = 0;
-int allowed_lull = 0;
int prune_empty_dirs = 0;
int use_qsort = 0;
char *files_from = NULL;
int delay_updates = 0;
long block_size = 0; /* "long" because popt can't set an int32. */
char *skip_compress = NULL;
+item_list dparam_list = EMPTY_ITEM_LIST;
/** Network address family. **/
int default_af_hint
/* All the following options switch us into daemon-mode option-parsing. */
{"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
+ {"dparam", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
{"detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{"no-detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 },
{0,0,0,0, 0, 0, 0}
rprintf(F," --address=ADDRESS bind to the specified address\n");
rprintf(F," --bwlimit=KBPS limit I/O bandwidth; KBytes per second\n");
rprintf(F," --config=FILE specify alternate rsyncd.conf file\n");
+ rprintf(F," -M, --dparam=OVERRIDE override global daemon config parameter\n");
rprintf(F," --no-detach do not detach from the parent\n");
rprintf(F," --port=PORT listen on alternate port number\n");
rprintf(F," --log-file=FILE override the \"log file\" setting\n");
{"bwlimit", 0, POPT_ARG_INT, &daemon_bwlimit, 0, 0, 0 },
{"config", 0, POPT_ARG_STRING, &config_file, 0, 0, 0 },
{"daemon", 0, POPT_ARG_NONE, &daemon_opt, 0, 0, 0 },
+ {"dparam", 'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
{"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 },
{"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 },
{"detach", 0, POPT_ARG_VAL, &no_detach, 0, 0, 0 },
pc = poptGetContext(RSYNC_NAME, argc, argv,
long_daemon_options, 0);
while ((opt = poptGetNextOpt(pc)) != -1) {
+ char **cpp;
switch (opt) {
case 'h':
daemon_usage(FINFO);
exit_cleanup(0);
+ case 'M':
+ arg = poptGetOptArg(pc);
+ if (!strchr(arg, '=')) {
+ rprintf(FERROR,
+ "--dparam value is missing an '=': %s\n",
+ arg);
+ goto daemon_error;
+ }
+ cpp = EXPAND_ITEM_LIST(&dparam_list, char *, 4);
+ *cpp = strdup(arg);
+ break;
+
case 'v':
verbose++;
break;
}
}
+ if (dparam_list.count && !set_dparams(1))
+ exit_cleanup(RERR_SYNTAX);
+
if (tmpdir && strlen(tmpdir) >= MAXPATHLEN - 10) {
snprintf(err_buf, sizeof err_buf,
"the --temp-dir path is WAY too long.\n");