[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: sendmail-8.9.2 and openldap-1.1.*



At 07:46 AM 1/27/99 -0800, ; wrote:
>my impression that all this would happen in OpenLdap 2.0, and 
>that Openldap 1.1.* would remain with the older V2 api. 

This is correct.
  OpenLDAP 1.x implements the U-Mich API (rfc1823 with mods).
  OpenLDAP 2.x (-devel) will implement the current API draft spec
	(ietf-ldapext-draft-ldap-c-api-02.txt)

>	
>>Unfortunately LDAP_OPT_DEREF, LDAP_OPT_TIMELIMIT, and LDAP_OPT_SIZELIMIT
>>aren't defined anywhere in the header files for sendmail or openldap.

LDAP_OPT_DEREF is defined in ldap.h (pretty much any flavor).
Same goes for REFERRAL and RESTART.   LDAP_OPT_TIMELIMIT/SIZELIMIT
are post U-Mich defines.

>>There is however the following set of definitions in the ldap.h header
>>file:
>>
>>#define LDAP_VERSION1   1
>>#define LDAP_VERSION2   2
>>#define LDAP_VERSION3   3
>>#define LDAP_VERSION LDAP_VERSION2

These are for specifying protocol levels, not API levels.  I do
not recommend using these to detect the API level.

Instead:

#if defined(LDAP_API_VERSION)
	/* LDAP_API_VERSION must be defined per the current draft spec
	** it's value will be assigned RFC number.  However, as
	** no RFC is defined, it's value is currently implementation
	** specific (though I would hope it's value is greater than 1823).
	** In OpenLDAP 2.x-devel, its 2000 + the draft number, ie 2002.
	*/
#elif defined( LDAP_OPT_SIZELIMIT )
	/*
	** Netscape SDK w/ ldap_set_option, ldap_get_option
	*/
#else
	/* U-Mich/OpenLDAP 1.x API */
	/* RFC-1823 w/ changes */
#endif

If all you are checking for is ldap_set_option(), then checking for
LDAP_OPT_SIZELIMIT should be good enough.  However, note, there are
other API differences where a more complex check may be needed.

Kurt