summaryrefslogtreecommitdiff
path: root/receiver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-03-26 09:59:14 -0700
committerWayne Davison <wayned@samba.org>2011-03-26 10:09:20 -0700
commit78286a03d196efeed754aa4c1faa571f5dbea342 (patch)
tree6ba67b8ae2397f5a55278f5a7041d9b0a9d2d197 /receiver.c
parentd699d815d6acdf18f73788c21f3be5e6611cfecf (diff)
downloadrsync-78286a03d196efeed754aa4c1faa571f5dbea342.tar.gz
Avoid re-setting (and sending) xattrs on a hard-linked file w/the same xattrs.
Improved the xattrs testing to include hard-linking.
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/receiver.c b/receiver.c
index a5192475..7641b9b5 100644
--- a/receiver.c
+++ b/receiver.c
@@ -548,14 +548,16 @@ int recv_files(int f_in, int f_out, char *local_name)
rprintf(FINFO, "recv_files(%s)\n", fname);
#ifdef SUPPORT_XATTRS
- if (iflags & ITEM_REPORT_XATTR && do_xfers)
+ if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
+ && (protocol_version < 31 || !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
recv_xattr_request(file, f_in);
#endif
if (!(iflags & ITEM_TRANSFER)) {
maybe_log_item(file, iflags, itemizing, xname);
#ifdef SUPPORT_XATTRS
- if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers)
+ if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
+ && !BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE))
set_file_attrs(fname, file, NULL, fname, 0);
#endif
if (iflags & ITEM_IS_NEW) {