From 9bcb25958de5e2b6a852f67122472cc66471525f Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 22 Jan 2005 22:48:27 +0000 Subject: [PATCH] - Mustn't override a user-specified list_only value. - Moved the computing of the options for the server down until after we've figured out the protocol_version for the transfer. - If we're talking to a protocol-29 server in list-only mode, force the new --list-only mode (which avoids the -r with --exclude="/*/*" kluge). - Output the options we sent to the daemon if verbose > 1. --- clientserver.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/clientserver.c b/clientserver.c index ec74054f..58a2f2c2 100644 --- a/clientserver.c +++ b/clientserver.c @@ -112,7 +112,7 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out, char *p; if (argc == 0 && !am_sender) - list_only = 1; + list_only |= 1; if (*path == '/') { rprintf(FERROR, @@ -125,19 +125,6 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out, if (!user) user = getenv("LOGNAME"); - /* set daemon_over_rsh to false since we need to build the - * true set of args passed through the rsh/ssh connection; - * this is a no-op for direct-socket-connection mode */ - daemon_over_rsh = 0; - server_options(sargs, &sargc); - - sargs[sargc++] = "."; - - if (path && *path) - sargs[sargc++] = path; - - sargs[sargc] = NULL; - io_printf(f_out, "@RSYNCD: %d\n", protocol_version); if (!read_line(f_in, line, sizeof line - 1)) { @@ -154,6 +141,25 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out, if (protocol_version > remote_protocol) protocol_version = remote_protocol; + if (list_only && protocol_version >= 29) + list_only |= 2; + + /* set daemon_over_rsh to false since we need to build the + * true set of args passed through the rsh/ssh connection; + * this is a no-op for direct-socket-connection mode */ + daemon_over_rsh = 0; + server_options(sargs, &sargc); + + sargs[sargc++] = "."; + + if (path && *path) + sargs[sargc++] = path; + + sargs[sargc] = NULL; + + if (verbose > 1) + print_child_argv(sargs); + p = strchr(path,'/'); if (p) *p = 0; io_printf(f_out, "%s\n", path); -- 2.34.1