Bugzilla – Bug 1226656
rsync --chown sets permissions to root:root after upgrade to Leap 15.6
Last modified: 2024-07-04 13:34:02 UTC
Hi, On the client: ``` rsync -a --delete --super --owner --group --chown=477:479 --chmod='u=rwX,g=rX,o=' $PWD/ rsync://saltpush@witch1.infra.opensuse.org:873/salt-push/ ``` On the server, rsyncd.socket is listening with the following /etc/rsyncd.conf: ``` # Salt managed defaults address = :: gid = users log format = %h %o %f %l %b secrets file = /etc/rsyncd.secrets transfer logging = True use chroot = True # Salt managed modules [salt-push] path = /srv/salt-git/ comment = /srv/salt-git/ list = false uid = root gid = salt auth users = saltpush read only = False hosts allow = 2a07:de40:b27e:1203::126, 2a07:de40:b27e:1203::127 ``` With Leap 15.5, sync operations would keep the expected permissions and ownership on the directory /srv/salt-git and its contents. After the upgrade to Leap 15.6, which installed `rsync-3.2.7-150600.1.5.x86_64` on both the client and server side, the following happens: ``` root@witch1 ~# chown -R 477:479 /srv/salt-git root@witch1 ~# ls -dn /srv/salt-git drwxr-x--- 1 477 479 426 Jun 20 16:35 /srv/salt-git/ 8ec7287bf746:/srv/salt-git # rsync -a --delete --owner --group --chown=477:479 --chmod='u=rwX,g=rX,o=' $PWD/ rsync://saltpush@witch1.infra.opensuse.org:873/salt-push/ root@witch1 ~# ls -dn /srv/salt-git drwxr-x--- 1 0 0 426 Jun 20 16:35 /srv/salt-git/ ``` The directory gets recursively owned as root:root instead of keeping 477:479.
Hi Georg, Does this happen if you use latest version 3.3.0 from network project in OBS? https://download.opensuse.org/repositories/network/15.6/x86_64/rsync-3.3.0-lp156.165.1.x86_64.rpm
Hi David, thanks for getting back. I installed the you linked on both the client and server, but the behavior unfortunately is still the same.
Hi Georg, can you try adding `--numeric-ids` flags (as you are using `--chown=477:479`)? Also, are you running rsync as root?
I already tried using `--numeric-ids`, it did not help - on the client side, rsync is running as root - on the server side, rsyncd is initiated as root by the systemd socket, and the module is configured with "uid root" as well.
I cannot reproduce the issue, I think we are missing something. Can you try passing --super to the remote (-M--super) and see if it works (or removing it altogether, as you are root on both ends?).
Thanks for investigating. The result is the same with these command lines: ``` # rsync -a --delete --owner --group --chown=477:479 --chmod='u=rwX,g=rX,o=' $PWD/ rsync://saltpush@witch1.infra.opensuse.org:873/salt-push/ # rsync -a --delete -M--super --super --owner --group --chown=477:479 --chmod='u=rwX,g=rX,o=' $PWD/ rsync://saltpush@witch1.infra.opensuse.org:873/salt-push/ ``` Both with and without the target directory previously manually chown-d. I now found out that the behavior also exists when calling rsync on a 15.6 client towards a 15.5 server.