rsync --chmod affects the source permissions as well as destination permissions
Graham Leggett
minfrin at sharp.fm
Mon May 5 20:32:23 UTC 2025
On 05 May 2025, at 20:14, Derek Martin <demartin at akamai.com> wrote:
> If I understand correctly, I believe using --chmod without using
> --perms (or with --no-p) will do what you want. Typical command lines
> often use -a which equates to -rlptgoD (i.e. it includes -p/--perms).
> So you either need to not use -a and instead use the remaining
> combination of options explicitly, or use --no-p.
>
> See the man page, specifically the sections for --perms and -a.
When I stepped this through the debugger I found that this was not the case.
The flaw is on this line:
https://github.com/RsyncProject/rsync/blob/de4c5f7bb004d972045a2667f8d7a523386fc0e6/rsync.c#L579
The value of --chmod is being written to the fake xattrs, and this breaks the backups. The alternative is not to have --chmod, but this makes the backups inaccessible to the people needing to restore the backups.
The fix is here:
https://github.com/RsyncProject/rsync/pull/751
Regards,
Graham
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20250505/63ce3331/attachment.htm>
More information about the rsync
mailing list