[Alpine-info] ldap-servers and $USER possible?

David Morris dwm at xpasc.com
Thu May 28 06:25:55 PDT 2009



Can you use a different environment variable, eg $ADUSER and set it
externally the catenated string .... if bash is the shell:
export ADUSER=myad\\myuser


On Thu, 28 May 2009, Liam Gretton wrote:


> 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

> _______________________________________________

> Alpine-info mailing list

> Alpine-info at u.washington.edu

> http://mailman2.u.washington.edu/mailman/listinfo/alpine-info

>



More information about the Alpine-info mailing list