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

Re: sendmail-8.9.2 and openldap-1.1.*



-----BEGIN PGP SIGNED MESSAGE-----

In article <36AE34E8.C39C8B5E@Princeton.EDU>,
Curtis Hillegas  <curt@Princeton.EDU> wrote:
>I'm trying to build sendmail-8.9.2 with the openldap-1.1.* (currently
>1.1.4) libraries.  I get the following errors:
>
>/usr/princeton/bin/gcc -O -I. -I/usr/local/include -DNDBM -DNIS
>-DNISPLUS -DMAP_REGEX -DLDAPMAP -DSOLARIS=20500  -c  map.c
>map.c: In function `ldap_map_start':
>map.c:2695: `LDAP_OPT_DEREF' undeclared (first use this function)
>map.c:2695: (Each undeclared identifier is reported only once
>map.c:2695: for each function it appears in.)
>map.c:2696: `LDAP_OPT_TIMELIMIT' undeclared (first use this function)
>map.c:2697: `LDAP_OPT_SIZELIMIT' undeclared (first use this function)
>*** Error code 1
>make: Fatal error: Command failed for target `map.o'

- - Openldap is moving to the API defined in LDAP version 3. It was
my impression that all this would happen in OpenLdap 2.0, and 
that Openldap 1.1.* would remain with the older V2 api. 

	
>Unfortunately LDAP_OPT_DEREF, LDAP_OPT_TIMELIMIT, and LDAP_OPT_SIZELIMIT
>aren't defined anywhere in the header files for sendmail or openldap. 
>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
>
>That kinda makes it so the sendmail #ifdef's above don't perform as
>expected, and the version 3 ldap stuff is used rather than the version 2
>stuff.  It's an easy fix, but since openldap-1.1.* is the current
>recommended library to use for building ldap into sendmail it would be
>nice to have an official patch (maybe combined with the sendmail-LDAP
>patch from last week).


- - Okay, now I see the problem. Here's the patch 

- - Booker C. Bense 

/usr/pubsw/bin/diff -u map.c map.c~
- --- map.c       Wed Jan 27 07:36:46 1999
+++ map.c~      Tue Dec 29 09:42:26 1998
@@ -2670,7 +2670,7 @@
                ev = setevent(lmap->timeout.tv_sec, ldaptimeout, 0);
        }
 
- -#if( LDAP_VERSION == LDAP_VERSION3 )
+#ifdef LDAP_VERSION3
        ld = ldap_init(lmap->ldaphost,lmap->ldapport);
 #else
        ld = ldap_open(lmap->ldaphost,lmap->ldapport);
@@ -2691,7 +2691,7 @@
                return FALSE;
        }
 
- -#if(LDAP_VERSION == LDAP_VERSION3)
+#ifdef LDAP_VERSION3
        ldap_set_option(ld, LDAP_OPT_DEREF, &lmap->deref);
        ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &lmap->timelimit);
        ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &lmap->sizelimit);



-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNq805wD83u1ILnWNAQHMVgQApwVFEB9XWVQ4aQYJ5VYG0PQKhFuMPE5V
TIBDmUJaSSdQPyb52OuM1TWN1nZGYYsOVNjXHelDJPKOYRHkKMzePrnsEsU2bDJJ
v03HnKsjSim9ulxPRijZ+KIx/uFXC79a5thz0kRVQ/jkf1sOQ2P37bvO0KMN+Y1p
c00QNyIBFeA=
=lLJe
-----END PGP SIGNATURE-----