[Alpine-info] ldap-servers and $USER possible?
Liam Gretton
liam.gretton at leicester.ac.uk
Thu May 28 04:35:18 PDT 2009
On 17/04/2009 14:49, Eduardo Chappa wrote:
> On Fri, 17 Apr 2009, Liam Gretton wrote:
>
> :) Every means of quoting and escaping I've tried has failed. Here's what
> :) I have ldap-servers set to currently:
> :)
> :) ldap-servers=host.com:port "/base=dc=host,dc=com/binddn=${USER}"
>
> You need to recompile Alpine to make this work.
[snip]
> I did not try this, but it should work.
It does indeed, thanks.
Unfortunately my example above isn't the whole story, so I still have a
problem. The username actually ahs to be prefixed with an AD domain name
(e.g. dom\user). Introducing the backslash prevents the expansion of
the environment variable though, no matter how I try to escape the slash
itself. Having looked at the expand_variables() function in pith/conf.c
I can see there are two means of escaping using \\$ or $$, but the
closest I get is by using:
ldap-servers=host.com:port "/base=dc=host,dc=com/binddn=dom\$${USER}"
which becomes dom\$user instead of dom\user.
I wonder if there's a bug in expand_variables() where \\$ is expanded
here are lines 4758 and 4759 of pith/conf.c:
#if !(defined(DOS) || defined(OS2))
if(*src == '\\' && *(src+1) == '$'){
I think that second line be
if(*src == '\\' && *(src+2) == '$'){
When it is, I can use
ldap-servers=host.com:port "/base=dc=host,dc=com/binddn=dom\\\${USER}"
and get the correct expansion.
--
Liam Gretton liam.gretton at le.ac.uk
HPC Architect http://www.le.ac.uk/its/
IT Services Tel: +44 (0)116 2522254
University Of Leicester, University Road
Leicestershire LE1 7RH, United Kingdom
More information about the Alpine-info
mailing list