[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Mon Aug 1 14:07:54 UTC 2022


The branch, master has been updated
       via  7e5424b8 More improvements to file-list checking
      from  43f70b96 The latest NEWS.

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


- Log -----------------------------------------------------------------
commit 7e5424b806e8eea053016268ad186276e9083b77
Author: Wayne Davison <wayne at opencoder.net>
Date:   Mon Aug 1 07:00:51 2022 -0700

    More improvements to file-list checking
    
    - Avoid implied rules on generator and (with extra certainty) on server
    - Add -R implied-directory path elements as directory includes
    - Log about extra file-list checking using a new --debug=FILTER3 level

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

Summary of changes:
 exclude.c | 21 ++++++++++++++++-----
 main.c    |  1 +
 options.c |  2 +-
 3 files changed, 18 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/exclude.c b/exclude.c
index b670c8ba..2d740a83 100644
--- a/exclude.c
+++ b/exclude.c
@@ -25,6 +25,7 @@
 
 extern int am_server;
 extern int am_sender;
+extern int am_generator;
 extern int eol_nulls;
 extern int io_error;
 extern int xfer_dirs;
@@ -309,7 +310,7 @@ void add_implied_include(const char *arg)
 	int slash_cnt = 1; /* We know we're adding a leading slash. */
 	const char *cp;
 	char *p;
-	if (old_style_args || list_only || filesfrom_host != NULL)
+	if (am_server || old_style_args || list_only || filesfrom_host != NULL)
 		return;
 	if (relative_paths) {
 		cp = strstr(arg, "/./");
@@ -363,11 +364,16 @@ void add_implied_include(const char *arg)
 					}
 					if (!found) {
 						filter_rule *R_rule = new0(filter_rule);
-						R_rule->rflags = FILTRULE_INCLUDE + (saw_wild ? FILTRULE_WILD : 0);
+						R_rule->rflags = FILTRULE_INCLUDE | FILTRULE_DIRECTORY
+							       | (saw_wild ? FILTRULE_WILD : 0);
 						R_rule->pattern = strdup(rule->pattern);
 						R_rule->u.slash_cnt = slash_cnt;
 						R_rule->next = implied_filter_list.head;
 						implied_filter_list.head = R_rule;
+						if (DEBUG_GTE(FILTER, 3)) {
+							rprintf(FINFO, "[%s] add_implied_include(%s/)\n",
+								who_am_i(), rule->pattern);
+						}
 					}
 				}
 				slash_cnt++;
@@ -381,6 +387,8 @@ void add_implied_include(const char *arg)
 		*p = '\0';
 		rule->u.slash_cnt = slash_cnt;
 		arg = (const char *)rule->pattern;
+		if (DEBUG_GTE(FILTER, 3))
+			rprintf(FINFO, "[%s] add_implied_include(%s)\n", who_am_i(), rule->pattern);
 	}
 
 	if (recurse || xfer_dirs) {
@@ -416,6 +424,8 @@ void add_implied_include(const char *arg)
 		rule->u.slash_cnt = slash_cnt + 1;
 		rule->next = implied_filter_list.head;
 		implied_filter_list.head = rule;
+		if (DEBUG_GTE(FILTER, 3))
+			rprintf(FINFO, "[%s] add_implied_include(%s)\n", who_am_i(), rule->pattern);
 	}
 }
 
@@ -833,11 +843,12 @@ static void report_filter_result(enum logcode code, char const *name,
 				 filter_rule const *ent,
 				 int name_flags, const char *type)
 {
+	int log_level = am_sender || am_generator ? 1 : 3;
+
 	/* If a trailing slash is present to match only directories,
 	 * then it is stripped out by add_rule().  So as a special
-	 * case we add it back in here. */
-
-	if (DEBUG_GTE(FILTER, 1)) {
+	 * case we add it back in the log output. */
+	if (DEBUG_GTE(FILTER, log_level)) {
 		static char *actions[2][2]
 		    = { {"show", "hid"}, {"risk", "protect"} };
 		const char *w = who_am_i();
diff --git a/main.c b/main.c
index 5a7fbdd7..fa263d27 100644
--- a/main.c
+++ b/main.c
@@ -1078,6 +1078,7 @@ static int do_recv(int f_in, int f_out, char *local_name)
 	}
 
 	am_generator = 1;
+	implied_filter_list.head = implied_filter_list.tail = NULL;
 	flist_receiving_enabled = True;
 
 	io_end_multiplex_in(MPLX_SWITCHING);
diff --git a/options.c b/options.c
index 93bdb237..9731a144 100644
--- a/options.c
+++ b/options.c
@@ -293,7 +293,7 @@ static struct output_struct debug_words[COUNT_DEBUG+1] = {
 	DEBUG_WORD(DELTASUM, W_SND|W_REC, "Debug delta-transfer checksumming (levels 1-4)"),
 	DEBUG_WORD(DUP, W_REC, "Debug weeding of duplicate names"),
 	DEBUG_WORD(EXIT, W_CLI|W_SRV, "Debug exit events (levels 1-3)"),
-	DEBUG_WORD(FILTER, W_SND|W_REC, "Debug filter actions (levels 1-2)"),
+	DEBUG_WORD(FILTER, W_SND|W_REC, "Debug filter actions (levels 1-3)"),
 	DEBUG_WORD(FLIST, W_SND|W_REC, "Debug file-list operations (levels 1-4)"),
 	DEBUG_WORD(FUZZY, W_REC, "Debug fuzzy scoring (levels 1-2)"),
 	DEBUG_WORD(GENR, W_REC, "Debug generator functions"),


-- 
The rsync repository.



More information about the rsync-cvs mailing list