Compilation fails when configured with
# ./configure --with-openldap --without-sasl
# make
[...]
gcc -shared -O2 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I../include -I../lib
-fPIC -D_GNU_SOURCE -DAUTOFS_LIB_DIR=\"/usr/lib/autofs\"
-DAUTOFS_MAP_DIR=\"/etc/autofs\" -DLDAP_DEPRECATED=1 -o lookup_ldap.so \
                lookup_ldap.c dclist.o  \
                ../lib/autofs.a -lldap -llber -lresolv 
lookup_ldap.c: In function ‘bind_ldap_simple’:
lookup_ldap.c:144: error: ‘LDAP_AUTH_USESIMPLE’ undeclared (first use in this
function)
lookup_ldap.c:144: error: (Each undeclared identifier is reported only once
lookup_ldap.c:144: error: for each function it appears in.)
lookup_ldap.c: In function ‘do_reconnect’:
lookup_ldap.c:729: warning: unused variable ‘uri’
make[1]: *** [lookup_ldap.so] Error 1
make[1]: Leaving directory `/var/tmp/autofs/modules'
make: *** [daemon] Error 2

Following patch against git sources fixes this problem. LDAP_AUTH_USESIMPLE is
only declared when HAVE_SASL is true, so check only for it in this case.

From 3b5eef5379e5ab87815f1e4caf8c5a556485fac3 Mon Sep 17 00:00:00 2001
From: Dustin Polke <[email protected]>
Date: Sun, 30 May 2010 14:54:06 +0200
Subject: [PATCH] Fix compilation of modules/lookup_ldap.c for '--with-openldap
--without-sasl'.

LDAP_AUTH_USESIMPLE is only defined when configured with '--with-sasl'.
Therefore only check for it if HAVE_SASL is true.
---
 modules/lookup_ldap.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index e9d1fa2..c1c8ab4 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -140,10 +140,13 @@ static void uris_mutex_unlock(struct lookup_context *ctxt)
 int bind_ldap_simple(unsigned logopt, LDAP *ldap, const char *uri, struct
lookup_context *ctxt)
 {
        int rv;
-
+#ifdef WITH_SASL
        if (ctxt->auth_required == LDAP_AUTH_USESIMPLE)
                rv = ldap_simple_bind_s(ldap, ctxt->user, ctxt->secret);
        else if (ctxt->version == 2)
+#else
+       if (ctxt->version == 2)
+#endif
                rv = ldap_simple_bind_s(ldap, ctxt->base, NULL);
        else
                rv = ldap_simple_bind_s(ldap, NULL, NULL);
-- 
1.6.4.4


_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to