int verbose = 0;
int quiet = 0;
+int output_motd = 1;
int log_before_transfer = 0;
int stdout_format_has_i = 0;
int stdout_format_has_o_or_i = 0;
rprintf(F,"Options\n");
rprintf(F," -v, --verbose increase verbosity\n");
rprintf(F," -q, --quiet suppress non-error messages\n");
+ rprintf(F," --no-motd suppress daemon-mode MOTD (see manpage caveat)\n");
rprintf(F," -c, --checksum skip based on checksum, not mod-time & size\n");
rprintf(F," -a, --archive archive mode; same as -rlptgoD (no -H)\n");
rprintf(F," --no-OPTION turn off an implied OPTION (e.g. --no-D)\n");
{"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
{"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 },
{"quiet", 'q', POPT_ARG_NONE, 0, 'q', 0, 0 },
+ {"motd", 0, POPT_ARG_VAL, &output_motd, 1, 0, 0 },
+ {"no-motd", 0, POPT_ARG_VAL, &output_motd, 0, 0, 0 },
{"stats", 0, POPT_ARG_NONE, &do_stats, 0, 0, 0 },
{"human-readable", 'h', POPT_ARG_NONE, 0, 'h', 0, 0},
{"dry-run", 'n', POPT_ARG_NONE, &dry_run, 0, 0, 0 },
void option_error(void)
{
if (!err_buf[0]) {
- strcpy(err_buf, "Error parsing options: "
- "option may be supported on client but not on server?\n");
+ strlcpy(err_buf, "Error parsing options: option may "
+ "be supported on client but not on server?\n",
+ sizeof err_buf);
}
rprintf(FERROR, RSYNC_NAME ": %s", err_buf);
const char *arg;
OFF_T size = 1;
- for (arg = *size_arg; isdigit(*(uchar*)arg); arg++) {}
+ for (arg = *size_arg; isDigit(arg); arg++) {}
if (*arg == '.')
- for (arg++; isdigit(*(uchar*)arg); arg++) {}
+ for (arg++; isDigit(arg); arg++) {}
switch (*arg && *arg != '+' && *arg != '-' ? *arg++ : def_suf) {
case 'b': case 'B':
reps = 0;
case OPT_DAEMON:
if (am_daemon) {
- strcpy(err_buf, "Attempt to hack rsync thwarted!\n");
+ strlcpy(err_buf,
+ "Attempt to hack rsync thwarted!\n",
+ sizeof err_buf);
return 0;
}
poptFreeContext(pc);
clean_fname(partial_dir, 1);
if (!*partial_dir || strcmp(partial_dir, ".") == 0)
partial_dir = NULL;
- else if (*partial_dir != '/') {
+ else if (*partial_dir != '/' && !am_server) {
parse_rule(&filter_list, partial_dir,
MATCHFLG_NO_PREFIXES|MATCHFLG_DIRECTORY, 0);
}
argstr[x++] = 'n';
if (preserve_links)
argstr[x++] = 'l';
- if (xfer_dirs > (recurse || !delete_mode || !am_sender))
+ if (xfer_dirs > (recurse || !delete_mode || !am_sender ? 1 : 0))
argstr[x++] = 'd';
if (am_sender) {
if (keep_dirlinks)