A few more minor tweaks.
authorWayne Davison <wayne@opencoder.net>
Tue, 2 Aug 2022 01:21:28 +0000 (18:21 -0700)
committerWayne Davison <wayne@opencoder.net>
Tue, 2 Aug 2022 01:36:21 +0000 (18:36 -0700)
exclude.c
rsync.1.md

index 0100efc7c432362a309b79b486787a225ed53f5f..cd77c543b44b6b1f4073f2321e9d4a4e59c0535c 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -395,11 +395,10 @@ void add_implied_include(const char *arg)
        if (recurse || xfer_dirs) {
                /* Now create a rule with an added "/" & "**" or "*" at the end */
                rule = new0(filter_rule);
+               rule->rflags = FILTRULE_INCLUDE | FILTRULE_WILD;
                if (recurse)
-                       rule->rflags = FILTRULE_INCLUDE | FILTRULE_WILD | FILTRULE_WILD2;
-               else
-                       rule->rflags = FILTRULE_INCLUDE | FILTRULE_WILD;
-               /* A +4 in the len leaves enough room for / * * \0 or / * \0 \0 */
+                       rule->rflags |= FILTRULE_WILD2;
+               /* We must leave enough room for / * * \0. */
                if (!saw_wild && backslash_cnt) {
                        /* We are appending a wildcard, so now the backslashes need to be escaped. */
                        p = rule->pattern = new_array(char, arg_len + backslash_cnt + 3 + 1);
index 576dd90b62d99d4b6e7418a51c8291404d98a6c1..0c27df4c45bb825842abb158d6a59a9f1c6275c8 100644 (file)
@@ -180,17 +180,16 @@ an absolute or relative path that tries to escape out of the top of the
 transfer.  Also, beginning with version 3.2.5, rsync does two more safety
 checks of the file list to (1) ensure that no extra source arguments were added
 into the transfer other than those that the client requested and (2) ensure
-that the file list obeys the exclude rules that we sent to the sender.
+that the file list obeys the exclude rules that were sent to the sender.
 
-For those that don't yet have a 3.2.5 client rsync, it is safest to do a copy
-into a dedicated destination directory for the remote files rather than
-requesting the remote content get mixed in with other local content.  For
-example, doing an rsync copy into your home directory is potentially unsafe on
-an older rsync if the remote rsync is being controlled by a bad actor:
+For those that don't yet have a 3.2.5 client rsync (or those that want to be
+extra careful), it is safest to do a copy into a dedicated destination
+directory for the remote files when you don't trust the remote host.  For
+example, instead of doing an rsync copy into your home directory:
 
 >     rsync -aiv host1:dir1 ~
 
-A safer command would be:
+Dedicate a "host1-files" dir to the remote content:
 
 >     rsync -aiv host1:dir1 ~/host1-files