[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Wed Jun 24 00:40:38 UTC 2020


The branch, master has been updated
       via  323c42d5 Improve how the env restricts negotiated strings
       via  d1fdf9ff Avoid -U if --atimes is disabled.
       via  e93f40d8 Apple needs a leading underscore.
       via  4df1b1d4 Makefile.in: Use srcdir for installing rsync-ssl
       via  1af58f6b Improve the info about compression.
      from  a8fc8fc2 Preparing for release of 3.2.1

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 323c42d51e2a7d94dd641d7be5de89a2704d441c
Author: Wayne Davison <wayne at opencoder.net>
Date:   Tue Jun 23 17:19:58 2020 -0700

    Improve how the env restricts negotiated strings
    
    - The env on the server side now affects the negotiated strings
      that are sent to the client.
    - A too-old remote rsync gets a default negotiated string value
      so that an env restriction now handles old clients the same way
      as new ones.

commit d1fdf9ff8dad4f64259d78f8bc912aed782848d9
Author: Wayne Davison <wayne at opencoder.net>
Date:   Tue Jun 23 15:53:47 2020 -0700

    Avoid -U if --atimes is disabled.

commit e93f40d8b4068a0170ec0d8a6d6ab74850ba358f
Author: Wayne Davison <wayne at opencoder.net>
Date:   Tue Jun 23 15:47:27 2020 -0700

    Apple needs a leading underscore.

commit 4df1b1d4fe213d4409d5fad962f831837a4c7e23
Author: Hiroshi Takekawa <sian.ht at gmail.com>
Date:   Tue Jun 23 19:17:53 2020 +0900

    Makefile.in: Use srcdir for installing rsync-ssl
    
    When building out of source tree, we can't find rsync-ssl in the current
    directory and installation fails.  Fix it by using the srcdir variable for the
    path to rsync-ssl.
    
    Signed-off-by: Hiroshi Takekawa <sian.ht at gmail.com>

commit 1af58f6b77154a3b3d40e40647220c4d54ee6cdc
Author: Wayne Davison <wayne at opencoder.net>
Date:   Mon Jun 22 20:37:52 2020 -0700

    Improve the info about compression.

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in           |  2 +-
 checksum.c            |  2 +-
 compat.c              | 35 +++++++++++++++++-----------
 lib/md5-asm-x86_64.S  |  4 ++++
 rsync.1.md            | 64 +++++++++++++++++++++++++--------------------------
 testsuite/daemon.test | 13 ++++++-----
 6 files changed, 66 insertions(+), 54 deletions(-)


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 6ca7d9eb..e13e241b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -77,7 +77,7 @@ all: Makefile rsync$(EXEEXT) stunnel-rsyncd.conf @MAKE_MAN@
 install: all
 	-${MKDIR_P} ${DESTDIR}${bindir}
 	${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
-	${INSTALLCMD} -m 755 rsync-ssl ${DESTDIR}${bindir}
+	${INSTALLCMD} -m 755 $(srcdir)/rsync-ssl ${DESTDIR}${bindir}
 	-${MKDIR_P} ${DESTDIR}${mandir}/man1
 	-${MKDIR_P} ${DESTDIR}${mandir}/man5
 	if test -f rsync.1; then ${INSTALLMAN} -m 644 rsync.1 ${DESTDIR}${mandir}/man1; fi
diff --git a/checksum.c b/checksum.c
index 87e83658..7c915173 100644
--- a/checksum.c
+++ b/checksum.c
@@ -85,7 +85,7 @@ static const char *checksum_name(int num)
 {
 	struct name_num_item *nni = get_nni_by_num(&valid_checksums, num);
 
-	return nni ? nni->name : num < CSUM_MD4 ? "MD4" : "UNKNOWN";
+	return nni ? nni->name : num < CSUM_MD4 ? "md4" : "UNKNOWN";
 }
 
 void parse_checksum_choice(int final_call)
diff --git a/compat.c b/compat.c
index 9ec39ea0..7a97cfc3 100644
--- a/compat.c
+++ b/compat.c
@@ -390,20 +390,12 @@ static void send_negotiate_str(int f_out, struct name_num_obj *nno, const char *
 {
 	char tmpbuf[MAX_NSTR_STRLEN];
 	const char *list_str = getenv(env_name);
-	int len, fail_if_empty = list_str && strstr(list_str, "FAIL");
+	int len;
 
-	if (!do_negotiated_strings) {
-		if (!am_server && fail_if_empty) {
-			rprintf(FERROR, "Remote rsync is too old for %s negotiation\n", nno->type);
-			exit_cleanup(RERR_UNSUPPORTED);
-		}
-		return;
-	}
-
-	if (list_str && *list_str && (!am_server || local_server)) {
+	if (list_str && *list_str) {
 		init_nno_saw(nno, 0);
 		len = parse_nni_str(nno, list_str, tmpbuf, MAX_NSTR_STRLEN);
-		if (fail_if_empty && !len)
+		if (!len)
 			len = strlcpy(tmpbuf, "FAIL", MAX_NSTR_STRLEN);
 		list_str = tmpbuf;
 	} else
@@ -423,7 +415,7 @@ static void send_negotiate_str(int f_out, struct name_num_obj *nno, const char *
 		/* A local server doesn't bother to send/recv the strings, it just constructs
 		 * and parses the same string on both sides. */
 		recv_negotiate_str(-1, nno, tmpbuf, len);
-	} else {
+	} else if (do_negotiated_strings) {
 		/* Each side sends their list of valid names to the other side and then both sides
 		 * pick the first name in the client's list that is also in the server's list. */
 		write_vstring(f_out, tmpbuf, len);
@@ -442,13 +434,28 @@ static void negotiate_the_strings(int f_in, int f_out)
 
 	if (valid_checksums.saw) {
 		char tmpbuf[MAX_NSTR_STRLEN];
-		recv_negotiate_str(f_in, &valid_checksums, tmpbuf, -1);
+		int len;
+		if (do_negotiated_strings)
+			len = -1;
+		else
+			len = strlcpy(tmpbuf, protocol_version >= 30 ? "md5" : "md4", MAX_NSTR_STRLEN);
+		recv_negotiate_str(f_in, &valid_checksums, tmpbuf, len);
 	}
 
 	if (valid_compressions.saw) {
 		char tmpbuf[MAX_NSTR_STRLEN];
-		recv_negotiate_str(f_in, &valid_compressions, tmpbuf, -1);
+		int len;
+		if (do_negotiated_strings)
+			len = -1;
+		else
+			len = strlcpy(tmpbuf, "zlib", MAX_NSTR_STRLEN);
+		recv_negotiate_str(f_in, &valid_compressions, tmpbuf, len);
 	}
+
+	/* If the other side is too old to negotiate, the above steps just made sure that
+	 * the env didn't disallow the old algorithm. Mark things as non-negotiated. */
+	if (!do_negotiated_strings)
+		valid_checksums.negotiated_name = valid_compressions.negotiated_name = NULL;
 }
 
 void setup_protocol(int f_out,int f_in)
diff --git a/lib/md5-asm-x86_64.S b/lib/md5-asm-x86_64.S
index 814aac59..383f193a 100644
--- a/lib/md5-asm-x86_64.S
+++ b/lib/md5-asm-x86_64.S
@@ -29,6 +29,10 @@
 
 #if !defined USE_OPENSSL && CSUM_CHUNK == 64
 
+#ifdef __APPLE__
+#define md5_process_asm _md5_process_asm
+#endif
+
 .text
 .align 16
 
diff --git a/rsync.1.md b/rsync.1.md
index 9d9dfbae..ebd59dca 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -1490,7 +1490,8 @@ your home directory (remove the '=' for that).
     a negotiation between the client and the server as follows:
 
     If both the client and the server are at least version 3.2.0, they will
-    exchange a list of checksum names and choose the first one in the list that
+    exchange a list of checksum names and choose the first one in the client's
+    list that
     they have in common.  This typically means that they will choose xxh64 if
     they both support it and fall back to MD5.  If one side of the transfer is
     not new enough to support this checksum negotiation, then a value is chosen
@@ -1503,8 +1504,8 @@ your home directory (remove the '=' for that).
     client exits with an error.  This method does not allow you to specify the
     transfer checksum separately from the pre-transfer checksum, and it ignores
     "auto" and all unknown checksum names.  If the remote rsync is not new
-    enough to handle a checksum negotiation list, the list is silently ignored
-    unless it contains the string "FAIL".
+    enough to handle a checksum negotiation list, its list is assumed to
+    consist of a single "md5" or "md4" item based on the protocol version.
 
     The use of the `--checksum-choice` option overrides this environment list.
 
@@ -2260,24 +2261,27 @@ your home directory (remove the '=' for that).
     destination machine, which reduces the amount of data being transmitted --
     something that is useful over a slow connection.
 
-    The "zlib" compression method typically achieves better compression ratios
-    than can be achieved by using a compressing remote shell or a compressing
-    transport because it takes advantage of the implicit information in the
-    matching data blocks that are not explicitly sent over the connection.
-    This matching-data compression comes at a cost of CPU, though, and can be
-    disabled by using the "zlibx" compresson method instead.  This can be
-    selected by repeating the `-z` option or specifying
-    `--compress-choice=zlibx`, but it only works if both sides of the transfer
-    are at least version 3.1.1.
+    Rsync supports multiple compression methods and will choose one for you
+    unless you force the choice using the `--compress-choice` option.
 
-    Note that if you see an error about an option named `--old-compress` or
-    `--new-compress`, this is rsync trying to send the `--compress-choice=zlib`
-    or `--compress-choice=zlibx` option in a backward-compatible manner that
-    more rsync versions understand.  This error indicates that the older rsync
-    version will not allow you to force the compression type.
+    Run `rsync -V` to see the compress list compiled into your version.
+
+    When both sides of the transfer are at least 3.2.0, rsync chooses the first
+    algorithm in the client's list of choices that is also in the server's list
+    of choices.  Your default order can be customized by setting the environment
+    variable RSYNC_COMPRESS_LIST to a space-separated list of acceptable
+    compression names.  If no common compress choice is found, the client exits
+    with an error.  If the remote rsync is too old to support checksum negotiation,
+    its list is assumed to be "zlib".
+
+    There are some older rsync versions that were configured to reject a `-z`
+    option and require the use of `-zz` because their compression library was
+    not compatible with the default zlib compression method.  You can usually
+    ignore this weirdness unless the rsync server complains and tells you to
+    specify `-zz`.
 
-    See the `--skip-compress` option for the default list of file suffixes that
-    will not be compressed.
+    See also the `--skip-compress` option for the default list of file suffixes
+    that will trasnferred with no (or minimal) compression.
 
 0.  `--compress-choice=STR`, `--zc=STR`
 
@@ -2294,24 +2298,20 @@ your home directory (remove the '=' for that).
 
     Run `rsync -V` to see the compress list compiled into your version.
 
-    The "zlibx" algorithm is given preference over "zlib" if both sides of the
-    transfer are at least version 3.2.0, otherwise it will choose "zlib" unless
-    you override it via something like `-zz`.  These 2 algorithms are the stame
-    except that "zlibx" does not try to include matched data that was not
-    transferred in the compression computations.
+    Note that if you see an error about an option named `--old-compress` or
+    `--new-compress`, this is rsync trying to send the `--compress-choice=zlib`
+    or `--compress-choice=zlibx` option in a backward-compatible manner that
+    more rsync versions understand.  This error indicates that the older rsync
+    version on the server will not allow you to force the compression type.
+
+    Note that the "zlibx" compression algorithm is just the "zlib" algorithm
+    with matched data excluded from the compression stream (to try to make it
+    more compatible with an external zlib implementation).
 
     If "none" is specified, that is equivalent to using `--no-compress`.
 
     This option implies `--compress` unless "none" was specified.
 
-    You can also override the compression negotiation using the
-    RSYNC_COMPRESS_LIST environment variable by setting it to a space-separated
-    list of compression names that you consider acceptable.  If no common
-    compress choice is found, the client exits with an error.  It ignores
-    "auto" and all unknown compression names.  If the remote rsync is not new
-    enough to handle a compression negotiation list, the list is silently
-    ignored unless it contains the string "FAIL".
-
 0.  `--compress-level=NUM`, `--zl=NUM`
 
     Explicitly set the compression level to use (see `--compress`, `-z`)
diff --git a/testsuite/daemon.test b/testsuite/daemon.test
index a8acd04e..a736ee83 100644
--- a/testsuite/daemon.test
+++ b/testsuite/daemon.test
@@ -91,12 +91,13 @@ drwxr-xr-x         DIR ####/##/## ##:##:## foo
 EOT
 diff $diffopt "$chkfile" "$outfile" || test_fail "test 3 failed"
 
-$RSYNC -rU localhost::test-from/f* \
-    | sed "$FILE_REPL" | sed "$DIR_REPL" | sed "$LS_REPL" \
-    | tee "$outfile"
-cat <<EOT >"$chkfile"
+if $RSYNC --version | grep "[, ] atimes" >/dev/null; then
+    $RSYNC -rU localhost::test-from/f* \
+	| sed "$FILE_REPL" | sed "$DIR_REPL" | sed "$LS_REPL" \
+	| tee "$outfile"
+    cat <<EOT >"$chkfile"
 drwxr-xr-x         DIR ####/##/## ##:##:##                     foo
 -rw-r--r--           4 ####/##/## ##:##:## ####/##/## ##:##:## foo/one
 EOT
-diff $diffopt "$chkfile" "$outfile" || test_fail "test 3 failed"
-
+    diff $diffopt "$chkfile" "$outfile" || test_fail "test 3 failed"
+fi


-- 
The rsync repository.



More information about the rsync-cvs mailing list