X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/d365e229678eb7ae758a415d100043f6e07dea35..327c559aff771314cef19d9485d317a08283da01:/main.c diff --git a/main.c b/main.c index e2d6aa7f..76692e1b 100644 --- a/main.c +++ b/main.c @@ -68,6 +68,7 @@ extern char *basis_dir[]; extern char *rsync_path; extern char *shell_cmd; extern char *batch_name; +extern char *password_file; extern char curr_dir[MAXPATHLEN]; extern struct filter_list_struct server_filter_list; @@ -630,7 +631,6 @@ static void read_final_goodbye(int f_in, int f_out) } } - static void do_server_sender(int f_in, int f_out, int argc, char *argv[]) { struct file_list *flist; @@ -671,9 +671,8 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[]) } flist = send_file_list(f_out,argc,argv); - if (!flist || flist->count == 0) { + if (!flist || flist->count == 0) exit_cleanup(0); - } the_file_list = flist; io_start_buffering_in(); @@ -701,7 +700,7 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) #ifdef SUPPORT_HARD_LINKS if (preserve_hard_links) - init_hard_links(); + match_hard_links(); #endif if (fd_pair(error_pipe) < 0) { @@ -784,7 +783,6 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name) return exit_code; } - static void do_server_recv(int f_in, int f_out, int argc,char *argv[]) { int exit_code; @@ -905,12 +903,10 @@ void start_server(int f_in, int f_out, int argc, char *argv[]) keep_dirlinks = 0; /* Must be disabled on the sender. */ if (need_messages_from_generator) io_start_multiplex_in(); - recv_filter_list(f_in); do_server_sender(f_in, f_out, argc, argv); - } else { + } else do_server_recv(f_in, f_out, argc, argv); - } exit_cleanup(0); } @@ -1023,7 +1019,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) return MAX(exit_code, exit_code2); } -static int copy_argv (char *argv[]) +static int copy_argv(char *argv[]) { int i; @@ -1135,6 +1131,12 @@ static int start_client(int argc, char *argv[]) } } + if (password_file && !daemon_over_rsh) { + rprintf(FERROR, "The --password-file option may only be " + "used when accessing an rsync daemon.\n"); + exit_cleanup(RERR_SYNTAX); + } + if (shell_machine) { p = strrchr(shell_machine,'@'); if (p) { @@ -1365,6 +1367,9 @@ int main(int argc,char *argv[]) } if (read_batch) read_stream_flags(batch_fd); + else + write_stream_flags(batch_fd); + } if (write_batch < 0) dry_run = 1;