- Fixed a bug I introduced into the daemon's "fake super" handling.
authorWayne Davison <wayned@samba.org>
Fri, 27 Oct 2006 07:43:28 +0000 (07:43 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 27 Oct 2006 07:43:28 +0000 (07:43 +0000)
- Make sure that the client can't send the daemon --fake-super.

fake-super.diff

index 69a823c..1d5f8ac 100644 (file)
@@ -61,16 +61,18 @@ After applying this patch, run these commands for a successful build:
  
 --- old/clientserver.c
 +++ new/clientserver.c
-@@ -284,6 +284,9 @@ static int rsync_module(int f_in, int f_
-       pid_t pre_exec_pid = 0;
-       char *request = NULL;
+@@ -625,6 +625,11 @@ static int rsync_module(int f_in, int f_
+       ret = parse_arguments(&argc, (const char ***) &argv, 0);
+       quiet = 0; /* Don't let someone try to be tricky. */
  
-+      if (lp_fake_super(i) != 0)
++      if (lp_fake_super(i))
 +              am_root = -1;
++      else if (am_root < 0) /* Treat --fake-super from client as --super. */
++              am_root = 2;
 +
-       if (!allow_access(addr, host, lp_hosts_allow(i), lp_hosts_deny(i))) {
-               rprintf(FLOG, "rsync denied on module %s from %s (%s)\n",
-                       name, host, addr);
+       if (filesfrom_fd == 0)
+               filesfrom_fd = f_in;
 --- old/generator.c
 +++ new/generator.c
 @@ -1510,13 +1510,14 @@ void generate_files(int f_out, struct fi