rsync icon indicating copy to clipboard operation
rsync copied to clipboard

--usermap and --chown option flags are not working as intended.

Open gannon345 opened this issue 2 years ago • 1 comments

currently on rsync 3.2.3.

When running a command with options to change the destination owner and group, it doesn't work, and assigns the permissions and group of the user who issues the command.

e.g.

When running as root, do: sync -ruv --ignore-existing --usermap=*:testuser --groupmap=*:testuser /path/to/source/ /path/to/destination/

or

rsync -ruv --ignore-existing --chown=testuser:testuser /path/to/source/ /path/to/destination/ The files in the destination are created with root:root for owner and group. Likewise, if I ran the command with the account testuser3, the permissions would be testuser3:testuser3, instead of the specified testuser:testuser

gannon345 avatar Nov 08 '23 08:11 gannon345

Actually, now I'm wondering if the issue might be a regression related to this: https://github.com/WayneD/rsync/issues/242

Sure enough, when I do the following it works exactly as expected: rsync -ruv --ignore-existing --chown=testuser:testuser --owner --group /path/to/source/ /path/to/destination/

gannon345 avatar Nov 08 '23 08:11 gannon345

The latest rsync implies --owner & --group when --chown is used.

WayneD avatar Apr 06 '24 15:04 WayneD