James Tavares wrote:

> Hi there,
>
> I have so far been unsuccessful in getting (the latest) qmail-ldap to 
> work with OpenLDAP 2.1.2.
>
> I know the problem is that qmail-ldap connects using LDAPv2 and 
> OpenLDAP 2.1.2 supports only LDAPv3, dropping support for LDAPv2 all 
> together....
>
> I tried to do a ldap_set_option() in the source code to set the 
> LDAP_OPT_PROTOCOL to LDAP_VERSION3 right after ldap_init(), but it 
> does not seem to take effect??
>
> Any thoughts?
>
> Thanks,
> James


qldap-ldaplib.c

Sorry, I caught my mistake. I thrown off by the comment that said "This 
is for Mozilla SDK only" that was surrounded by an #ifdef 
LDAP_OPT_PROTOCOL_VERSION just a few lines lower..

I read 'Mozilla only' and figured it was NOT being executed for 
OpenLDAP, when really LDAP_OPT_PROTOCOL_VERSION is infact in the 
OpenLDAP libs as well as the mozilla libs...

I had added my code to ldap_set_option(...VERSION 3..) *above* the 
"Mozilla SDK only..." code that sets the protocol to version 2... So I 
set it to version 3, and then it would get set to version 2 right 
afterwards.

Just goes to show you, you can never trust a comment. The source is the 
ultimiate guide.

Anyway, obviously, for those who are interested, the easisest way to 
force an LDAPv3 connection is to on line #236 of qldap-ldaplib.c change 
VERSION2 to VERSION3.

Regards,

-James



Reply via email to