[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Fri Jun 12 06:09:34 UTC 2020


The branch, master has been updated
       via  d4fc18f3 Use the refused-option code to disable options that aren't compiled into the source.
       via  58680edb Improve checkcsum/compress info that may differ between packaged versions.
      from  34141954 Add packaging notes to NEWS.

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


- Log -----------------------------------------------------------------
commit d4fc18f3755987ccea6e7f43609f862aa0254c5a
Author: Wayne Davison <wayne at opencoder.net>
Date:   Thu Jun 11 22:26:59 2020 -0700

    Use the refused-option code to disable options that aren't compiled into the source.

commit 58680edb1278a8958375cf470974c4455bd6a74a
Author: Wayne Davison <wayne at opencoder.net>
Date:   Thu Jun 11 21:57:37 2020 -0700

    Improve checkcsum/compress info that may differ between packaged versions.

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

Summary of changes:
 options.c  | 39 ++++++++++++++++++++++++---------------
 rsync.1.md | 25 ++++++++++++++++++-------
 2 files changed, 42 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/options.c b/options.c
index a0c973ce..2e0f9da2 100644
--- a/options.c
+++ b/options.c
@@ -952,10 +952,8 @@ static struct poptOption long_options[] = {
   {"rsh",             'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
   {"rsync-path",       0,  POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
   {"temp-dir",        'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
-#ifdef ICONV_OPTION
   {"iconv",            0,  POPT_ARG_STRING, &iconv_opt, 0, 0, 0 },
   {"no-iconv",         0,  POPT_ARG_NONE,   0, OPT_NO_ICONV, 0, 0 },
-#endif
   {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
   {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
   {"8-bit-output",    '8', POPT_ARG_VAL,    &allow_8bit_chars, 1, 0, 0 },
@@ -969,9 +967,7 @@ static struct poptOption long_options[] = {
   {"password-file",    0,  POPT_ARG_STRING, &password_file, 0, 0, 0 },
   {"blocking-io",      0,  POPT_ARG_VAL,    &blocking_io, 1, 0, 0 },
   {"no-blocking-io",   0,  POPT_ARG_VAL,    &blocking_io, 0, 0, 0 },
-#ifdef HAVE_SETVBUF
   {"outbuf",           0,  POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
-#endif
   {"remote-option",   'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
   {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
   {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
@@ -1092,8 +1088,8 @@ static void set_refuse_options(void)
 	if (!ref)
 		ref = "";
 
-	if (!*ref && !am_daemon) /* A simple optimization */
-		return;
+	if (!am_daemon)
+		ref = "";
 
 	/* We abuse the descrip field in poptOption to make it easy to flag which options
 	 * are refused (since we don't use it otherwise).  Start by marking all options
@@ -1104,7 +1100,8 @@ static void set_refuse_options(void)
 			list_end = op;
 			break;
 		}
-		if (op->shortName == 'e' /* Required for compatibility flags */
+		if (!am_daemon
+		 || op->shortName == 'e' /* Required for compatibility flags */
 		 || op->shortName == '0' /* --from0 just modifies --files-from, so refuse that instead (or not) */
 		 || op->shortName == 's' /* --protect-args is always OK */
 		 || op->shortName == 'n' /* --dry-run is always OK */
@@ -1121,8 +1118,9 @@ static void set_refuse_options(void)
 	}
 	assert(list_end != NULL);
 
-	if (am_daemon) /* Refused by default, but can be accepted via "!write-devices" */
+	if (am_daemon) { /* Refused by default, but can be accepted via a negated exact match. */
 		parse_one_refuse_match(0, "write-devices", list_end);
+	}
 
 	while (1) {
 		while (*ref == ' ') ref++;
@@ -1148,6 +1146,13 @@ static void set_refuse_options(void)
 		parse_one_refuse_match(0, "log-file*", list_end);
 	}
 
+#ifndef ICONV_OPTION
+	parse_one_refuse_match(0, "iconv", list_end);
+#endif
+#ifndef HAVE_SETVBUF
+	parse_one_refuse_match(0, "outbuf", list_end);
+#endif
+
 	/* Now we use the descrip values to actually mark the options for refusal. */
 	for (op = long_options; op != list_end; op++) {
 		int refused = op->descrip[0] == 'r';
@@ -1259,15 +1264,19 @@ static OFF_T parse_size_arg(char **size_arg, char def_suf)
 
 static void create_refuse_error(int which)
 {
+	const char *msg;
+	if (am_daemon)
+		msg = "The server is configured to refuse";
+	else if (am_server)
+		msg = "The server does not support";
+	else
+		msg = "This rsync does not support";
+
 	/* The "which" value is the index + OPT_REFUSED_BASE. */
 	struct poptOption *op = &long_options[which - OPT_REFUSED_BASE];
-	int n = snprintf(err_buf, sizeof err_buf,
-			 "The server is configured to refuse --%s\n",
-			 op->longName) - 1;
-	if (op->shortName) {
-		snprintf(err_buf + n, sizeof err_buf - n,
-			 " (-%c)\n", op->shortName);
-	}
+	int n = snprintf(err_buf, sizeof err_buf, "%s --%s\n", msg, op->longName) - 1;
+	if (op->shortName)
+		snprintf(err_buf + n, sizeof err_buf - n, " (-%c)\n", op->shortName);
 }
 
 /* This is used to make sure that --daemon & --server cannot be aliased to
diff --git a/rsync.1.md b/rsync.1.md
index 743d3b92..47b16acb 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -1463,8 +1463,15 @@ your home directory (remove the '=' for that).
     comma-separated names are supplied, the first name affects the transfer
     checksums, and the second name affects the pre-transfer checksums (`-c`).
 
-    The algorithm choices are "auto", "xxh64" (aka "xxhash"), "MD5", "MD4", and
-    "none".
+    The checksum options that you may be able to use are:
+
+    - `auto` (the default)
+    - `xxh64` (aka xxhash)
+    - `md5`
+    - `md4`
+    - `none`
+
+    Run `rsync -V` to see the default checksum list compiled into your version.
 
     If "none" is specified for the first (or only) name, the `--whole-file`
     option is forced on and no checksum verification is performed on the
@@ -1491,8 +1498,6 @@ your home directory (remove the '=' for that).
     enough to handle a checksum negotiation list, the list is silently ignored
     unless it contains the string "FAIL".
 
-    Use "rsync -V" to see the default checksum list.
-
     The use of the `--checksum-choice` option overrides this environment list.
 
 0.  `--one-file-system`, `-x`
@@ -2266,7 +2271,15 @@ your home directory (remove the '=' for that).
     This option can be used to override the automatic selection of the
     compression algorithm that is the default when `--compress` is used.
 
-    Currently the STR can be "zlibx", "zlib", or "none".
+    The compression options that you may be able to use are:
+
+    - `zstd`
+    - `lz4`
+    - `zlibx`
+    - `zlib`
+    - `none`
+
+    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
@@ -2286,8 +2299,6 @@ your home directory (remove the '=' for that).
     enough to handle a compression negotiation list, the list is silently
     ignored unless it contains the string "FAIL".
 
-    Use "rsync -V" to see the default compress list.
-
 0.  `--compress-level=NUM`
 
     Explicitly set the compression level to use (see `--compress`) instead of


-- 
The rsync repository.



More information about the rsync-cvs mailing list