bug: xattr filter rule treated as file filter rule on the remote side

Andras Nagy andras at nagya.net
Sun Apr 29 03:31:11 UTC 2018

Summary: an xattr filter rule (e.g. --filter='-x! user.*’, which is suggested by the documentation) is treated as a file filter rule on the remote side.

Repro #1, sender is local:
host1$ rsync --filter=‘-x! user.*' -avvvHX --delete /tmp/test/. host2:test
[Receiver] add_rule(-! user.*)

Repro #2, sender is remote:
host1$ rsync --filter=‘-x! user.*' -avvvHX --delete host2:test/. /tmp/test
[sender] add_rule(-! user.*)

One possible and quite dangerous symptom of this is that the incorrect (-! user.*) rule matches (almost) all remote files, therefore in repro #1, no remote files are deleted, and in repro #2, nothing is transferred and all local files are deleted.

Environment: macOS 10.13.4, homebrew, https://github.com/Homebrew/homebrew-core/blob/master/Formula/rsync.rb
rsync  version 3.1.3  protocol version 31
   64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
   socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
   append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags

More information about the rsync mailing list