[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sun Apr 5 23:44:00 UTC 2020


The branch, master has been updated
       via  7f06cc7e Don't throw an error if a potential fuzzy dir isn't a dir
      from  10d40508 Use "exit 1" in atomic-rsync for error exit. Fixes bug #15469.

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


- Log -----------------------------------------------------------------
commit 7f06cc7ed0bc74628592fb7c669827e28b625582
Author: Wayne Davison <wayned at samba.org>
Date:   Sun Apr 5 16:41:15 2020 -0700

    Don't throw an error if a potential fuzzy dir isn't a dir
    
    Add a flag for calling get_dirlist() and for send_directory() that
    indicates that the dirname is allowed to not be a directory.  Based
    on a patch by Ben Rubson.  Fixes bug #13445.

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

Summary of changes:
 flist.c     | 8 +++++++-
 generator.c | 2 +-
 rsync.h     | 2 ++
 3 files changed, 10 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/flist.c b/flist.c
index c275e995..7d7d2c0f 100644
--- a/flist.c
+++ b/flist.c
@@ -1704,6 +1704,8 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
 				interpret_stat_error(fbuf, True);
 			return;
 		}
+		if (errno == ENOTDIR && (flags & FLAG_PERHAPS_DIR))
+			return;
 		io_error |= IOERR_GENERAL;
 		rsyserr(FERROR_XFER, errno, "opendir %s failed", full_fname(fbuf));
 		return;
@@ -3229,6 +3231,7 @@ struct file_list *get_dirlist(char *dirname, int dlen, int flags)
 	int save_xfer_dirs = xfer_dirs;
 	int save_prune_empty_dirs = prune_empty_dirs;
 	int senddir_fd = flags & GDL_IGNORE_FILTER_RULES ? -2 : -1;
+	int senddir_flags = FLAG_CONTENT_DIR;
 
 	if (dlen < 0) {
 		dlen = strlcpy(dirbuf, dirname, MAXPATHLEN);
@@ -3239,9 +3242,12 @@ struct file_list *get_dirlist(char *dirname, int dlen, int flags)
 
 	dirlist = flist_new(FLIST_TEMP, "get_dirlist");
 
+	if (flags & GDL_PERHAPS_DIR)
+		senddir_flags |= FLAG_PERHAPS_DIR;
+
 	recurse = 0;
 	xfer_dirs = 1;
-	send_directory(senddir_fd, dirlist, dirname, dlen, FLAG_CONTENT_DIR);
+	send_directory(senddir_fd, dirlist, dirname, dlen, senddir_flags);
 	xfer_dirs = save_xfer_dirs;
 	recurse = save_recurse;
 	if (INFO_GTE(PROGRESS, 1))
diff --git a/generator.c b/generator.c
index 0ceab185..3857151a 100644
--- a/generator.c
+++ b/generator.c
@@ -1305,7 +1305,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 			for (i = 0; i < fuzzy_basis; i++) {
 				if (i && pathjoin(fnamecmpbuf, MAXPATHLEN, basis_dir[i-1], dn) >= MAXPATHLEN)
 					continue;
-				fuzzy_dirlist[i] = get_dirlist(fnamecmpbuf, -1, GDL_IGNORE_FILTER_RULES);
+				fuzzy_dirlist[i] = get_dirlist(fnamecmpbuf, -1, GDL_IGNORE_FILTER_RULES | GDL_PERHAPS_DIR);
 				if (fuzzy_dirlist[i] && fuzzy_dirlist[i]->used == 0) {
 					flist_free(fuzzy_dirlist[i]);
 					fuzzy_dirlist[i] = NULL;
diff --git a/rsync.h b/rsync.h
index 641ba740..b1d16b37 100644
--- a/rsync.h
+++ b/rsync.h
@@ -87,9 +87,11 @@
 /* These flags are passed to functions but not stored. */
 
 #define FLAG_DIVERT_DIRS (1<<16)   /* sender, but must be unique */
+#define FLAG_PERHAPS_DIR (1<<17)   /* generator */
 
 /* These flags are for get_dirlist(). */
 #define GDL_IGNORE_FILTER_RULES (1<<0)
+#define GDL_PERHAPS_DIR (1<<1)
 
 /* Some helper macros for matching bits. */
 #define BITS_SET(val,bits) (((val) & (bits)) == (bits))


-- 
The rsync repository.



More information about the rsync-cvs mailing list