Skip to content

chown works differently between protocol versions 31 and 32 when using modules #829

@elcamlost

Description

@elcamlost

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions