If the user specifies --protocol=29, rsync will avoid sending an -e
authorWayne Davison <wayned@samba.org>
Fri, 11 Jul 2008 16:34:28 +0000 (09:34 -0700)
committerWayne Davison <wayned@samba.org>
Fri, 11 Jul 2008 16:48:33 +0000 (09:48 -0700)
option to the server (which is only useful for protocols 30 and above
anyway).  This gives the user an easy way to talk to a restricted
server that has overly restrictive option-checking.

NEWS
options.c

diff --git a/NEWS b/NEWS
index 5e92e72..924e788 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ Changes since 3.0.3:
     - Added the --remote-option=OPT (-M OPT) command-line option that is useful
       for things like sending a remote --log-file=FILE or --fake-super option.
 
+    - Rsync will not send an -e option to the server if the user specifies the
+      --protocol=29 option.  This lets rsync3 use an overly-restrictive server.
+
   DEVELOPER RELATED:
 
     - ...
index a79c553..d534cec 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1838,22 +1838,28 @@ void server_options(char **args, int *argc_p)
        if (do_compression)
                argstr[x++] = 'z';
 
-       /* We make use of the -e option to let the server know about any
-        * pre-release protocol version && some behavior flags. */
-       argstr[x++] = 'e';
+       set_allow_inc_recurse();
+
+       /* Checking the pre-negotiated value allows --protocol=29 override. */
+       if (protocol_version >= 30) {
+               /* We make use of the -e option to let the server know about
+                * any pre-release protocol version && some behavior flags. */
+               argstr[x++] = 'e';
 #if SUBPROTOCOL_VERSION != 0
-       if (protocol_version == PROTOCOL_VERSION) {
-               x += snprintf(argstr+x, sizeof argstr - x,
-                             "%d.%d", PROTOCOL_VERSION, SUBPROTOCOL_VERSION);
-       } else
+               if (protocol_version == PROTOCOL_VERSION) {
+                       x += snprintf(argstr+x, sizeof argstr - x,
+                                     "%d.%d",
+                                     PROTOCOL_VERSION, SUBPROTOCOL_VERSION);
+               } else
 #endif
-               argstr[x++] = '.';
-       set_allow_inc_recurse();
-       if (allow_inc_recurse)
-               argstr[x++] = 'i';
+                       argstr[x++] = '.';
+               if (allow_inc_recurse)
+                       argstr[x++] = 'i';
 #if defined HAVE_LUTIMES && defined HAVE_UTIMES
-       argstr[x++] = 'L';
+               argstr[x++] = 'L';
 #endif
+       }
+
        argstr[x] = '\0';
 
        if (x > (int)sizeof argstr) { /* Not possible... */