#ifdef ICONV_CONST
setup_iconv();
#endif
- if (protect_args)
+ if (protect_args && !daemon_over_rsh)
send_protected_args(*f_out_p, args);
}
if (daemon_filter_list.head) {
char *slash = strrchr(dest_path, '/');
- if (slash && slash[1] == '\0')
+ if (slash && (slash[1] == '\0' || (slash[1] == '.' && slash[2] == '\0')))
*slash = '\0';
else
slash = NULL;
- if (check_filter(&daemon_filter_list, FLOG, dest_path, 0) < 0
- || check_filter(&daemon_filter_list, FLOG, dest_path, 1) < 0) {
+ if ((*dest_path != '.' || dest_path[1] != '\0')
+ && (check_filter(&daemon_filter_list, FLOG, dest_path, 0) < 0
+ || check_filter(&daemon_filter_list, FLOG, dest_path, 1) < 0)) {
rprintf(FERROR, "skipping daemon-excluded destination \"%s\"\n",
dest_path);
exit_cleanup(RERR_FILESELECT);
rprintf(FERROR, "remote destination is not allowed with --read-batch\n");
exit_cleanup(RERR_SYNTAX);
}
- remote_argv = argv + argc - 1;
- remote_argc = 1;
+ remote_argv = argv += argc - 1;
+ remote_argc = argc = 1;
}
if (am_sender) {