Created attachment 9489 [details] Candidate patch on rsync 3.1.0. Please review. Example: rsync -Xa /foo /bar Expected: Copies will have the same security attributes as the originals. Reality: Copies have security attributes cleared. Please look at rsync-3.1.0/rsync.c lines 492 & 541 in the context of chown_common() from linux kernel fs/open.c around the 500th line. It appears that the SET{G,U}ID bits and security attrs are cleared. Relevant kernel line: if (!S_ISDIR(inode->i_mode)) newattrs.ia_valid |= ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV; Suggestion: move the SUPPORT_XATTRS code invocation after the if (change_uid... block.
The xattr-setting code was moved prior to the mtime setting due to some instances of xattr-setting tweaking it (e.g. os x resource fork info). So, to move it elsewhere, we'll need to change the xattr code (which currently signals the time-setting code when it thinks that the mtime might have been tweaked).
*** This bug has been marked as a duplicate of bug 10163 ***