If the user specifies --protocol=29, rsync will avoid sending an -e
authorWayne Davison <wayned@samba.org>
Thu, 24 Jul 2008 06:09:15 +0000 (23:09 -0700)
committerWayne Davison <wayned@samba.org>
Thu, 24 Jul 2008 06:09:15 +0000 (23:09 -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 df99b24ebd2a61a50704663b9bd77ca624d87b88..da273e1dcc0e3032a21a29a5d3479bb20b684149 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,12 @@ Changes since 3.0.3:
     - Changed the hard-link code to never try to allocate 0 bytes of memory.
       This fixes a failure on some Operating Systems, such as AIX.
 
+    -  Fixed a potential alignment issue in the IRIX ACL code when allocating
+       the initial "struct acl" object.  Also, cast mallocs to avoid warnings.
+
   ENHANCEMENTS:
 
-    - NONE
+    - Rsync will avoid sending an -e option to the server if an older protocol
+      in requested (and thus the option would not be useful).  This lets the
+      user specify the --protocol=29 option to access an overly-restrictive
+      server.
index 0ad26f894bae64dae8e9a4bcc979d684683e67e7..4bb2ab395362255c7f18acfb2196f230d06e94cc 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1808,22 +1808,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';
 
        args[ac++] = argstr;
@@ -2008,7 +2014,6 @@ void server_options(char **args, int *argc_p)
                         *   and it may be an older version that doesn't know this
                         *   option, so don't send it if client is the sender.
                         */
-                       int i;
                        for (i = 0; i < basis_dir_cnt; i++) {
                                args[ac++] = dest_option;
                                args[ac++] = basis_dir[i];