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
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 /.
command="rrsync -ro /some/path" ssh-...rsync --rsh="ssh -i ..." srchost:/ .Result:
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):