Bug 9246 - Add chroot enablement option to rsync client
Add chroot enablement option to rsync client
Product: rsync
Classification: Unclassified
Component: core
All All
: P5 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
Depends on:
  Show dependency treegraph
Reported: 2012-10-04 18:50 UTC by Bug Reporter
Modified: 2012-10-07 18:45 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Bug Reporter 2012-10-04 18:50:13 UTC
When running rsync on a directory that is meant to be a chroot, rsync will currently not correctly resolve symlinks with absolute targets because obviously, those targets are meant to be interpreted from inside the chroot.
Because of that, copy-unsafe-links and safe-links cannot be used properly in those cases.
It would be nice if there was an option to make the rsync client "chroot aware".
Comment 1 Wayne Davison 2012-10-07 18:45:04 UTC
One potential solution:

 rsync -aiv --rsync-path="chroot /chroot-path /usr/bin/rsync" src localhost:/dest

That does require you to have a working rsync inside the chroot, while a --chroot option would not.

If you don't have working ssh to localhost (or don't want to bother with localhost encryption), add "-e lsh" to the command and put the "lsh" shell script from the support dir on your path.  Make sure it is a recent copy, like this one:


If you want to make use of lsh's user options, you should instead put lsh into the chroot (along with rsync) and do this:

 rsync -aive "chroot /chroot-path /usr/local/bin/lsh" src user@localhost:/dest

I'm leaving this bug marked as an enhancement in case we want to add a --chroot option that makes it do a chroot internally.