Delayed variable expansion for P_PATH/P_STRING is missing (loadparm.c)

Florian Sager sager at
Mon Dec 23 12:42:31 MST 2013

Am 23.12.2013 20:05, schrieb Wayne Davison:
> On Tue, Dec 10, 2013 at 1:28 AM, Florian Sager <sager at
> <mailto:sager at>> wrote:
>     So I configured in the config file ($USER is set in the environment):
>     >>>
>     path = /home/%USER%/test
>     <<<
> $USER has to be set in the daemon's environment.  If it is set, it
> will be substituted.  If it is not set, rsync leaves it unchanged.
>  Since it worked fine in my testing, I'd imagine that whatever is
> starting your daemon process is not setting USER.
> ..wayne..
Hi Wayne,

are you sure you tried it with the 'path' directive?

The replacement of %USER% is working if I take another
non-P_PATH/P_STRING value, so the following code does the expansion:

    /* now switch on the type of variable it is */
    switch (parm_table[parmnum].type) {
    case P_PATH:
    case P_STRING:
        /* delay expansion of vars */
        /* expand any %VARS% now */
        parmvalue = expand_vars(parmvalue);

The important thing is the comment 'delay expansion of vars': these vars
should be expanded later in the code because e.g. the path will be
different for different users connecting.
But this 'delayed expansion' isn't done anywhere in the code ... at
least I cannot find another method call of 'expand_vars', do you?

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list