DO NOT REPLY [Bug 6191] rsyncd path does not support environmental variables

samba-bugs at samba-bugs at
Tue Oct 20 21:32:30 MDT 2009

wayned at changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

------- Comment #2 from wayned at  2009-10-20 22:32 CST -------
The git repository now supports the expansion of environment variables using
%VAR% references.  I chose this idiom because I thought it would be less likely
to have backward-compatibility issues, and it also stays with the DOS/Win style
of the config file.

You can reference environment variables in the values of settings only, which
does not include module names or parameter names.  All string values are
evaluated late so that they can include the variables listed in the manpage
section describing the pre-xfer exec scripts.  Values that are not strings
(such as "use chroot = BOOL") are expanded at config-reading time so that the
parameter can be set with the appropriate value type.

So, to get the authenticating user into a path as you requested (and indeed,
even into a uid setting) you can do things like this:

    path = /home/%RSYNC_USER_NAME%
    uid = %RSYNC_USER_NAME%
    gid = *
    auth users = sally susan sam steve

One thing you can't do is this:

secrets file = /home/%RSYNC_USER_NAME%/.rsync-secret

That's because the needed environment variable isn't set until after the name
and password has been validated.

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list