summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2009-10-08 21:01:43 +0000
committerArthur de Jong <arthur@arthurdejong.org>2009-10-08 21:01:43 +0000
commitdbc80a657d3aecb1dc052749ddf6de843ca2ba02 (patch)
tree8913e0c5dba452ec1bd36d84412a1c2c58e1246d
parentfb737703652bba6f6af50122f53f0c2348e5c75f (diff)
fix some header checks in configure and fix ldap_set_rebind_proc() return type check
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1003 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--configure.ac25
-rw-r--r--nslcd/myldap.c6
2 files changed, 14 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 4a46c2b..befcc0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,15 +197,13 @@ AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/un.h)
AC_CHECK_HEADERS(pthread.h)
-
-# NSS module-specific headers
-if test "x$enable_nss" = "xyes"
-then
- AC_CHECK_HEADERS(netinet/ether.h)
- AC_CHECK_HEADERS(shadow.h)
- AC_CHECK_HEADERS(aliases.h)
- AC_CHECK_HEADERS(nss.h)
-fi
+AC_CHECK_HEADERS(nss.h)
+AC_CHECK_HEADERS(netinet/ether.h)
+AC_CHECK_HEADERS(shadow.h)
+AC_CHECK_HEADERS(aliases.h)
+AC_CHECK_HEADERS(getopt.h)
+AC_CHECK_HEADERS(sys/ucred.h)
+AC_CHECK_HEADERS(ucred.h)
# PAM module-specific headers
if test "x$enable_pam" = "xyes"
@@ -219,12 +217,9 @@ then
AC_CHECK_HEADERS(pam/pam_modules.h)
fi
-# nslcd daemon-specific headers
+# LDAP-specific headers
if test "x$enable_nslcd" = "xyes"
then
- AC_CHECK_HEADERS(getopt.h)
- AC_CHECK_HEADERS(sys/ucred.h)
- AC_CHECK_HEADERS(ucred.h)
AC_CHECK_HEADERS(lber.h)
AC_CHECK_HEADERS(ldap.h,, test "x$enable_nslcd" = "xyes" && AC_MSG_ERROR([could not locate <ldap.h>]),[
#if HAVE_LBER_H
@@ -307,7 +302,7 @@ then
AC_SEARCH_LIBS(gethostbyname,nsl socket)
AC_SEARCH_LIBS(socket,socket)
-
+ # check for availability of functions
AC_CHECK_FUNCS(setgroups)
AC_CHECK_FUNCS(getpeereid)
AC_CHECK_FUNCS(getpeerucred)
@@ -316,6 +311,7 @@ then
# replace getopt_long() function if it is not on the system
AC_REPLACE_FUNCS(getopt_long)
+
# replace daemon() function if it is not on the system
AC_SEARCH_LIBS(daemon,bsd)
AC_REPLACE_FUNCS(daemon)
@@ -406,6 +402,7 @@ then
AC_CHECK_FUNCS(gss_krb5_ccache_name)
fi
+ # check for ldap function availability
AC_CHECK_FUNCS(ldap_parse_result ldap_memfree ldap_controls_free ldap_control_free)
AC_CHECK_FUNCS(ldap_explode_dn ldap_explode_rdn ldap_set_option ldap_get_option)
AC_CHECK_FUNCS(ldap_abandon ldap_simple_bind_s ldap_unbind ldap_set_rebind_proc)
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 7da3446..ca7328b 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -476,16 +476,16 @@ static int do_set_options(MYLDAP_SESSION *session)
http://www.openldap.org/software/man.cgi?query=ldap_set_rebind_proc&manpath=OpenLDAP+2.4-Release */
/* TODO: probably only set this if we should chase referrals */
log_log(LOG_DEBUG,"ldap_set_rebind_proc()");
- #if LDAP_SET_REBIND_PROC_TYPE == int
+#ifndef LDAP_SET_REBIND_PROC_RETURNS_VOID /* it returns int */
rc=ldap_set_rebind_proc(session->ld,do_rebind,session);
if (rc!=LDAP_SUCCESS)
{
log_log(LOG_ERR,"ldap_set_rebind_proc() failed: %s",ldap_err2string(rc));
return rc;
}
- #else /* LDAP_SET_REBIND_PROC_TYPE == void */
+#else /* ldap_set_rebind_proc() returns void */
ldap_set_rebind_proc(session->ld,do_rebind,session);
- #endif
+#endif
#endif /* HAVE_LDAP_SET_REBIND_PROC */
/* set the protocol version to use */
log_log(LOG_DEBUG,"ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,%d)",nslcd_cfg->ldc_version);