Skip to content

rrsync refuses "absolute" source path (starting with /) #922

@chrullrich

Description

@chrullrich

d4c4f67 added a single line to rrsync to "remove multiple leading slashes". By removing all leading slashes, this line ensures that the test for a leading slash four lines further down never succeeds and "absolute" paths below the rrsync base directory are not appended to that base directory anymore. This breaks rsync calls with, e.g., source path /.

  • .ssh/authorized_keys: command="rrsync -ro /some/path" ssh-...
  • command line elsewhere: rsync --rsh="ssh -i ..." srchost:/ .

Result:

/usr/local/sbin/rrsync error: unsafe arg: / ['', '/some/path']
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(232) [Receiver=3.4.3]

Using . as the rsync source path works, but is not intuitive. I don't think this change in behavior was intended.

Fix (perhaps not entirely serious):

while arg != (arg := arg.replace("//", "/")):
    pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions