[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sat Mar 16 18:18:21 UTC 2019


The branch, master has been updated
       via  d47d3792 Fix bug in try_dests_reg that Florian Zumbiehl pointed out.
      from  eb1b138e Clarify the cut-off point for --copy-safe-links.

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


- Log -----------------------------------------------------------------
commit d47d3792160210ce14700e38a223eaa0059f3551
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Mar 16 11:12:53 2019 -0700

    Fix bug in try_dests_reg that Florian Zumbiehl pointed out.
    
    If the alternate-destination code was scanning multiple alt dirs and it
    found the right size/mtime/checksum info but not the right xattrs, it
    would keep scanning the other dirs for a better xattr match, but it
    would omit the unchanged-file check that needs to happen first.

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

Summary of changes:
 generator.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/generator.c b/generator.c
index 6021a220..5538a92d 100644
--- a/generator.c
+++ b/generator.c
@@ -876,27 +876,22 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
 		pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
 		if (link_stat(cmpbuf, &sxp->st, 0) < 0 || !S_ISREG(sxp->st.st_mode))
 			continue;
-		switch (match_level) {
-		case 0:
+		if (match_level == 0) {
 			best_match = j;
 			match_level = 1;
-			/* FALL THROUGH */
-		case 1:
-			if (!unchanged_file(cmpbuf, file, &sxp->st))
-				continue;
+		}
+		if (!unchanged_file(cmpbuf, file, &sxp->st))
+			continue;
+		if (match_level == 1) {
 			best_match = j;
 			match_level = 2;
-			/* FALL THROUGH */
-		case 2:
-			if (!unchanged_attrs(cmpbuf, file, sxp)) {
-				free_stat_x(sxp);
-				continue;
-			}
+		}
+		if (unchanged_attrs(cmpbuf, file, sxp)) {
 			best_match = j;
 			match_level = 3;
 			break;
 		}
-		break;
+		free_stat_x(sxp);
 	} while (basis_dir[++j] != NULL);
 
 	if (!match_level)


-- 
The rsync repository.



More information about the rsync-cvs mailing list