Destination --chmod and --fake-super: chmod applied to fake-super, backup permissions lost
When attempting a backup of a source system running as root, and a destination system running as a normal user, --fake-super is used to keep track of source permissions, and --chmod is used to ensure that the backup is accessible to backup users on the target system.
In the process however, the addition of --chmod causes permissions to change both on the target filesystem, and within the attributes stored by fake super.
Once such a backup is restored, it is discovered that all source permissions are lost, replaced with the permissions specified by chmod.
With existing behaviour unchanged, a new option --chmod-dest is proposed that will affect the permissions of files and/or directories on the target system.
Patch to follow.
This question on superuser is relevant: https://superuser.com/questions/1406902/can-i-use-override-permissions-in-rsync-and-store-original-in-xattrs
The rsync daemon supports destination chmod (calling it incoming chmod), and the place where it is applied is here:
https://github.com/RsyncProject/rsync/blob/9994933c8ccf7ead27c81fe4ce2eb4e08af20c7f/rsync.c#L518
This does exclude symlinks.
Patch available here: https://github.com/RsyncProject/rsync/pull/751