RsyncProject / rsync

An open source utility that provides fast incremental file transfer. It also has useful features for backup and restore operations among many other use cases.
https://rsync.samba.org
Other
2.87k stars 337 forks source link

Feature request: Preserve MacOS symlink perms on Linux via xattr... #443

Open patniemeyer opened 1 year ago

patniemeyer commented 1 year ago

As you probably know, MacOS handles symlinks in a nonstandard way, allowing them to have distinct permissions from their target file via lstat() and lchmod(), whereas linux systems always report 777 for link perms. This can result in rsync perpetually seeing permission differences on symlinks when going between MacOS and Linux.

I'm wondering if there would be interest in supporting an option to store these (extra) symlink permissions in extended attributes on linux, allowing them to be preserved in a round trip.

Although I am not familiar with the rsync codebase I would be willing to take a shot at submitting a PR for this. But if this is not something you think is in scope for rsync please let me know. Thanks!

patniemeyer commented 1 year ago

I came across this old discussion in which you seem to endorse a simpler solution of just ignoring the permissions on symlinks when appropriate. Was there ever any work on that?

https://rsync.samba.narkive.com/700SrOfn/symlinks-in-os-x-10-4-1#post4