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);
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);
case OPT_EXCLUDE_FROM:
case OPT_INCLUDE_FROM:
arg = poptGetOptArg(pc);
- if (sanitize_paths) {
+ if (sanitize_paths)
arg = sanitize_path(NULL, arg, NULL, 0, NULL);
- die_on_unsafe_path((char*)arg, 0);
- }
if (server_filter_list.head) {
char *cp = strdup(arg);
if (!cp)
int i;
for (i = *argc; i-- > 0; )
(*argv)[i] = sanitize_path(NULL, (*argv)[i], "", 0, NULL);
- if (tmpdir) {
+ if (tmpdir)
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, NULL);
- die_on_unsafe_path(tmpdir, 0);
- }
- if (backup_dir) {
+ if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, NULL);
- die_on_unsafe_path(backup_dir, 0);
- }
}
if (server_filter_list.head && !am_sender) {
struct filter_list_struct *elp = &server_filter_list;
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)