Need to mark xattr rules in get_rule_prefix().
authorWayne Davison <wayned@samba.org>
Thu, 14 Jun 2018 22:19:34 +0000 (15:19 -0700)
committerWayne Davison <wayned@samba.org>
Thu, 14 Jun 2018 22:22:53 +0000 (15:22 -0700)
This fixes the bug of xattr filters getting sent as a normal filter rule
(since the 'x' was dropped in the prefix).

NEWS
exclude.c

diff --git a/NEWS b/NEWS
index 792df2317ac42b456519fc9560becd187be9c99b..1bcdba723150e6f3d0cdcdd9589136e7f2a17e85 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ Changes since 3.1.3:
 
   BUG FIXES:
 
+    - Fix xattr filter rules losing an 'x' attribute in a non-local transfer.
+
     - Fix a compiler error/warning about shifting a negative value (in the zlib
       code).
 
index 7989fb3e65dfb117e545affc0f23f4a94f6220c5..a0090b29a7656a1c82c7c5baee9dd4d7e40bd2df 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -1286,6 +1286,8 @@ char *get_rule_prefix(filter_rule *rule, const char *pat, int for_xfer,
        }
        if (rule->rflags & FILTRULE_EXCLUDE_SELF)
                *op++ = 'e';
+       if (rule->rflags & FILTRULE_XATTR)
+               *op++ = 'x';
        if (rule->rflags & FILTRULE_SENDER_SIDE
            && (!for_xfer || protocol_version >= 29))
                *op++ = 's';