I'm the maintainer of nss_ldapd [1] which is a replacement for nss_ldap. I have been trying to get rid of using deprecated functions while compiling with OpenLDAP 2.4.7.
One of the changes I made was using ldap_str2dn() instead of ldap_explode_dn() and ldap_explode_rdn() to parse the DN of entries returned. However, I ran into the following.
The relevant definitions for ldap_str2dn() in OpenLDAP 2.4.7 are:
typedef struct ldap_ava { [...] } LDAPAVA; typedef LDAPAVA** LDAPRDN; typedef LDAPRDN* LDAPDN; LDAP_F( int ) ldap_str2dn LDAP_P(( LDAP_CONST char *str, LDAPDN *dn, unsigned flags ));
While OpenLDAP 2.1.30 (another version I would like to support) there is:
typedef struct ldap_ava { [...] } LDAPAVA; typedef LDAPAVA** LDAPRDN; typedef LDAPRDN** LDAPDN; LDAP_F( int ) ldap_str2dn LDAP_P(( LDAP_CONST char *str, LDAPDN **dn, unsigned flags ));
This changes the second parameter from struct ldap_ava ******dn to struct ldap_****dn.
What is the best way to use lpap_str2dn() and still be able to compile (and run correctly because it is only a warning with most compilers) with both versions of OpenLDAP? Or would it be better to avoid the function completely?
Thanks.
[1] http://ch.tudelft.nl/~arthur/nss-ldapd/
Arthur de Jong wrote:
I'm the maintainer of nss_ldapd [1] which is a replacement for nss_ldap. I have been trying to get rid of using deprecated functions while compiling with OpenLDAP 2.4.7.
One of the changes I made was using ?ldap_str2dn() instead of ldap_explode_dn() and ldap_explode_rdn() to parse the DN of entries returned. However, I ran into the following.
The relevant definitions for ??ldap_str2dn() in OpenLDAP 2.4.7 are:
typedef struct ldap_ava { [...] } LDAPAVA; typedef LDAPAVA** LDAPRDN; typedef LDAPRDN* LDAPDN; LDAP_F( int ) ldap_str2dn LDAP_P(( LDAP_CONST char *str, LDAPDN *dn, unsigned flags ));
While OpenLDAP 2.1.30 (another version I would like to support) there is:
OpenLDAP 2.1? Why? That's been unsupported for 3-4 years already.
On Fri, 2008-04-04 at 16:31 -0700, Howard Chu wrote:
Arthur de Jong wrote:
I'm the maintainer of nss_ldapd [1] which is a replacement for nss_ldap. I have been trying to get rid of using deprecated functions while compiling with OpenLDAP 2.4.7.
[...]
While OpenLDAP 2.1.30 (another version I would like to support) there is:
OpenLDAP 2.1? Why? That's been unsupported for 3-4 years already.
Debian stable (etch) ships with that version and does security support for it. Also many other operating systems have older versions of LDAP libraries (e.g. Solaris 8) that I would like to support.
Arthur de Jong wrote:
On Fri, 2008-04-04 at 16:31 -0700, Howard Chu wrote:
Arthur de Jong wrote:
I'm the maintainer of nss_ldapd [1] which is a replacement for nss_ldap. I have been trying to get rid of using deprecated functions while compiling with OpenLDAP 2.4.7.
[...]
While OpenLDAP 2.1.30 (another version I would like to support) there is:
OpenLDAP 2.1? Why? That's been unsupported for 3-4 years already.
Debian stable (etch) ships with that version and does security support for it. Also many other operating systems have older versions of LDAP libraries (e.g. Solaris 8) that I would like to support.
That's Debian's and Solaris' business then, not OpenLDAP's. The fact distros don't stick with the latest development shifts maintenance and version compatibility burden on their side.
The fact binary compatibility broke at some minor version change quite some time ago is a sad fact, but it happened and was probably motivated; all OpenLDAP can do is stick with the current API, which makes more sense than the original one. Anything else would add more trouble without solving the issue. Note that you can easily detect what API is available by checking LDAP_VENDOR_VERSION_* macros (in ldap_features.h; don't need to explicitly include it, as it's handled by ldap.h).
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------
openldap-software@openldap.org