X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/311676ed21eb61ec49187b9dd064aef18997d470..d552250fbbd50e5ff2cd361d6218793b14e8cbc6:/main.c diff --git a/main.c b/main.c index 5fba5e68..0f160067 100644 --- a/main.c +++ b/main.c @@ -469,7 +469,7 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in #ifdef ICONV_CONST setup_iconv(); #endif - if (protect_args) + if (protect_args && !daemon_over_rsh) send_protected_args(*f_out_p, args); } @@ -509,12 +509,13 @@ static char *get_local_name(struct file_list *flist, char *dest_path) 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); @@ -1186,8 +1187,8 @@ static int start_client(int argc, char *argv[]) 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) {