rsyncd: --temp-dir outside of module or target target

Wayne Davison wayned at samba.org
Thu Aug 8 10:03:03 MDT 2013


On Mon, Aug 5, 2013 at 7:44 AM, <frank.gruellich at here.com> wrote:

> [cache]
>         path = /mnt/tst_vol_aws/sat_p_cache/

        use chroot = false
>
[...]

> On the client I run:
> /usr/bin/rsync --delete --ignore-errors -gpzsoltD
> --temp-dir=/mnt/tst_vol_aws/tmp/rsync -r /mnt/tst_vol_aws/sat_p_cache/
> rsync://$server_ip/cache


Rsync protects all paths from the user so that they cannot specify
something outside the module (which would be unsafe unless you fully trust
the users, which rsync assumes you do not since you are using daemon
protocol instead of a remote shell).  That said, you can specify some
options to make things less safe and thus accomplish what you want.

One solution:
- On the server side, create a symlink inside the module's hierarchy that
points to the temp area you want to use (or part of its parent path).  e.g.:
   ln -s ../tmp/rsync /mnt/tst_vol_aws/sat_p_cache/tmp-rsync
- Either specify "use chroot = false" in the module config (which you do)
or leave chrooting enabled and allow one directory higher outside the
module area to be included inside the chroot via a /./ dir (this would work
because I created a relative symlink above).  e.g.:
    path = /mnt/tst_vol_aws/./sat_p_cache
    use chroot = true
- You would then specify the symlink's path inside the module for your
temp-dir option. e.g.: --temp-dir=/tmp-rsync

..wayne..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20130808/a26f8c70/attachment.html>


More information about the rsync mailing list