-
Notifications
You must be signed in to change notification settings - Fork 453
Description
I've used the following rsync command to deploy files from my CI/CD runner to remote server:
rsync -vv --links --safe-links -avz --chown=remote_user:remote_group -e "ssh" /test-rsync/ root@remote-server::www/test-rsync/after upgrade from debian11 to debian12 it stopped to work as expected and started to user uid and gid on remote from the module configuration, ignoring chown settings.
after some debugging, it turned out that debian 11 rsync "version 3.2.3 protocol version 31" translates the above command to:
rsync -vv --links --safe-links -avz --usermap="*:remote_user" --groupmap="*:remote_group" -e "ssh" /test-rsync/ root@remote-server::www/test-rsync/
and debian 12 rsync "version 3.2.7 protocol version 32" translates the above command to:
rsync -vv --links --safe-links -avz --usermap="\*:remote_user" --groupmap="\*:remote_group" -e "ssh" /test-rsync/ root@remote-server::www/test-rsync/
Issue is the same for debian 13 as well.
and rsync on remote server (which is also debian 12) if it runs within module, is unable to properly interpret escaped asterisk symbol.
what is interesting though, that if I don't use module, rsync doesn't have a trouble to interpret escaped asterisk and the following works just fine in debian 12 and 13:
rsync -vv --links --safe-links -avz --usermap="\*:remote_user" --groupmap="\*:remote_group" -e "ssh" /test-rsync/ root@remote-server:/real/path/to/test-rsync/
Also, if I pass uid range explicitly instead of escaped asterisk, it works for protocol version 32 as well even with modules:
rsync -vv --links --safe-links -avz --usermap="0-99999:remote_user" --groupmap="0-99999:remote_group" -e "ssh" /test-rsync/ root@remote-server::www/test-rsync/
The module config I've used for this test:
[www]
max connections = 5
uid = root
gid = root
numeric ids = no
max verbosity = 10
use chroot = yes
name converter = /opt/scripts/nameconvert
path = /var/www
read only = no
outgoing chmod = D0775,F0664
incoming chmod = D0755,F0444
Not sure if this is an issue with rsync in general or something wrong with debian builds starting from debian 12.