Blame SOURCES/rsync-3.1.3-ignore-missing.patch

389997
commit af6118d98b3482cbcfc223bf2a0777bc19eccb02
389997
Author: Wayne Davison <wayne@opencoder.net>
389997
Date:   Sun Apr 26 18:02:17 2020 -0700
389997
389997
    Allow a missing parent dir when --delete-missing-args was specified.
389997
389997
diff --git a/generator.c b/generator.c
389997
index 3c50f63f..b90c7ccd 100644
389997
--- a/generator.c
389997
+++ b/generator.c
389997
@@ -1277,10 +1277,16 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
389997
 			 && (*dn != '.' || dn[1]) /* Avoid an issue with --relative and the "." dir. */
389997
 			 && (!prior_dir_file || strcmp(dn, f_name(prior_dir_file, NULL)) != 0)
389997
 			 && flist_find_name(cur_flist, dn, 1) < 0) {
389997
-				rprintf(FERROR,
389997
-					"ABORTING due to invalid path from sender: %s/%s\n",
389997
-					dn, file->basename);
389997
-				exit_cleanup(RERR_PROTOCOL);
389997
+				/* The --delete-missing-args option can actually put invalid entries into
389997
+				 * the file list, so if that option was specified, we'll just complain about
389997
+				 * it and allow it. */
389997
+				if (missing_args == 2 && file->mode == 0)
389997
+					rprintf(FERROR, "WARNING: parent dir is absent in the file list: %s\n", dn);
389997
+				else {
389997
+					rprintf(FERROR, "ABORTING due to invalid path from sender: %s/%s\n",
389997
+						dn, file->basename);
389997
+					exit_cleanup(RERR_PROTOCOL);
389997
+				}
389997
 			}
389997
 			if (relative_paths && !implied_dirs
389997
 			 && do_stat(dn, &sx.st) < 0) {
389997
@@ -1383,7 +1389,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
389997
 			added_perms = 0;
389997
 		if (is_dir < 0) {
389997
 			if (!(preserve_times & PRESERVE_DIR_TIMES))
389997
-				return;
389997
+				goto cleanup;
389997
 			/* In inc_recurse mode we want to make sure any missing
389997
 			 * directories get created while we're still processing
389997
 			 * the parent dir (which allows us to touch the parent
389997
@@ -1525,7 +1531,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
389997
 					"ignoring unsafe symlink \"%s\" -> \"%s\"\n",
389997
 					fname, sl);
389997
 			}
389997
-			return;
389997
+			goto cleanup;
389997
 		}
389997
 		if (statret == 0) {
389997
 			char lnk[MAXPATHLEN];