Client can trick daemon into running server code with am_server == 0

Wayne Davison
2007-02-16T01:23:10Z

On Wed, Feb 14, 2007 at 10:31:18PM -0500, Matt McCutchen
wrote:
> I noticed that an rsync daemon counts on the client sending a --server
> option so that am_server gets set to 1.

Yeah, we don't want that.  I checked in this change:

--- clientserver.c	4 Feb 2007 14:54:59 -0000	1.195
+++ clientserver.c	16 Feb 2007 01:20:29 -0000	1.196
@@ -626,6 +626,7 @@ static int rsync_module(int f_in, int f_
 	verbose = 0; /* future verbosity is controlled by client options */
 	ret = parse_arguments(&argc, (const char ***) &argv, 0);
 	quiet = 0; /* Don't let someone try to be tricky. */
+	am_server = 1; /* ditto */
 	if (lp_ignore_errors(module_id))
 		ignore_errors = 1;


..wayne..