cURL / Mailing Lists / curl-library / Single Mail

curl-library

LDAP improvements

From: Vilmos Nebehaj <vili_at_huwico.hu>
Date: Sun, 30 Oct 2005 12:49:26 +0100

Hey,

it seems that the LDAP code in libcurl can't handle LDAP servers of
LDAPv3 nor binary attributes in LDAP objects. So, I made a quick patch
to address these problems.

The solution is simple: if we connect to an LDAP server, first try
LDAPv3
(which is the preferred protocol as of now) and then fall back to
LDAPv2.
In case of binary attributes, we first convert them to base64, just
like the
openldap client does. It uses ldap_get_values_len() instead of
ldap_get_values() to be able to retrieve binary attributes correctly.
I defined
the necessary LDAP macros in lib/ldap.c to be able to compile libcurl
without the presence of libldap (libcurl uses dlopen() to load it
dynamically).

You can find the diff here: http://www.innoidea.com/~vili/
libcurl_ldap.diff

Any thoughts?

Thx,
- vili
Received on 2005-10-30