csomh / rpms / rsync

Forked from rpms/rsync 3 years ago
Clone

Blame SOURCES/rsync-3.1.2-remove-symlinks.patch

ffff3d
diff --git a/sender.c b/sender.c
ffff3d
index 03e4aadd..9b432ed9 100644
ffff3d
--- a/sender.c
ffff3d
+++ b/sender.c
ffff3d
@@ -32,6 +32,7 @@ extern int logfile_format_has_i;
ffff3d
 extern int want_xattr_optim;
ffff3d
 extern int csum_length;
ffff3d
 extern int append_mode;
ffff3d
+extern int copy_links;
ffff3d
 extern int io_error;
ffff3d
 extern int flist_eof;
ffff3d
 extern int allowed_lull;
ffff3d
@@ -138,17 +139,16 @@ void successful_send(int ndx)
ffff3d
 		return;
ffff3d
 	f_name(file, fname);
ffff3d
 
ffff3d
-	if (do_lstat(fname, &st) < 0) {
ffff3d
+	if ((copy_links ? do_stat(fname, &st) : do_lstat(fname, &st)) < 0) {
ffff3d
 		failed_op = "re-lstat";
ffff3d
 		goto failed;
ffff3d
 	}
ffff3d
 
ffff3d
-	if (S_ISREG(file->mode) /* Symlinks & devices don't need this check: */
ffff3d
-	 && (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
ffff3d
+	if (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
ffff3d
 #ifdef ST_MTIME_NSEC
ffff3d
 	 || (NSEC_BUMP(file) && (uint32)st.ST_MTIME_NSEC != F_MOD_NSEC(file))
ffff3d
 #endif
ffff3d
-	)) {
ffff3d
+	) {
ffff3d
 		rprintf(FERROR_XFER, "ERROR: Skipping sender remove for changed file: %s\n", fname);
ffff3d
 		return;
ffff3d
 	}