Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac41
-rw-r--r--nslcd/cfg.c4
-rw-r--r--nslcd/cfg.h1
-rw-r--r--nslcd/myldap.c4
-rw-r--r--pam/pam.c10
5 files changed, 52 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index c1e3288..79f75f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -222,7 +222,12 @@ AC_CHECK_HEADERS(sys/ucred.h)
AC_CHECK_HEADERS(ucred.h)
if test "x$enable_pam" = "xyes"
then
- AC_CHECK_HEADERS(security/pam_modules.h)
+ AC_CHECK_HEADERS(security/pam_appl.h)
+ AC_CHECK_HEADERS(security/pam_modules.h,,,[
+ #ifdef HAVE_SECURITY_PAM_APPL_H
+ #include <security/pam_appl.h>
+ #endif
+ ])
AC_CHECK_HEADERS(pam/pam_modules.h)
fi
if test "x$enable_sasl" = "xyes"
@@ -416,17 +421,39 @@ AC_CHECK_FUNCS(ldap_create_page_control ldap_parse_page_control,,[AC_LIBOBJ(page
# check the number of arguments that ldap_set_rebind_proc() uses
AC_CACHE_CHECK(
[number of arguments to ldap_set_rebind_proc],
- nss_ldapd_cv_ldap_set_rebind_proc,
+ nss_ldapd_cv_ldap_set_rebind_proc_args,
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <lber.h>
- #include <ldap.h>]],
- [[ldap_set_rebind_proc(0, 0, 0);]])],
- [nss_ldapd_cv_ldap_set_rebind_proc=3],
- [nss_ldapd_cv_ldap_set_rebind_proc=2]) ])
-AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS,$nss_ldapd_cv_ldap_set_rebind_proc,
+ #include <ldap.h>
+ ]],[[
+ ldap_set_rebind_proc(0,0,0);
+ ]])],
+ [nss_ldapd_cv_ldap_set_rebind_proc_args=3],
+ [nss_ldapd_cv_ldap_set_rebind_proc_args=2]) ])
+AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS,$nss_ldapd_cv_ldap_set_rebind_proc_args,
[Define to the number of arguments to ldap_set_rebindproc.])
+# check the return type of ldap_set_rebind_proc()
+AC_CACHE_CHECK(
+ [return type of ldap_set_rebind_proc],
+ nss_ldapd_cv_ldap_set_rebind_proc_type,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <lber.h>
+ #include <ldap.h>
+ ]],[[
+ #if LDAP_SET_REBIND_PROC_ARGS == 3
+ return ldap_set_rebind_proc(0,0,0);
+ #else
+ return ldap_set_rebind_proc(0,0);
+ #endif
+ ]])],
+ [nss_ldapd_cv_ldap_set_rebind_proc_type=int],
+ [nss_ldapd_cv_ldap_set_rebind_proc_type=void]) ])
+AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_TYPE, $nss_ldapd_cv_ldap_set_rebind_proc_type,
+ [Define as the return type of ldap_set_rebind_proc (`int' or `void').])
+
CFLAGS="$save_CFLAGS"
nslcd_LIBS="$LIBS"
LIBS="$save_LIBS"
diff --git a/nslcd/cfg.c b/nslcd/cfg.c
index 1a09b9d..e8a5408 100644
--- a/nslcd/cfg.c
+++ b/nslcd/cfg.c
@@ -457,6 +457,7 @@ static void get_gid(const char *filename,int lnr,
exit(EXIT_FAILURE);
}
+#ifdef LDAP_OPT_X_TLS
static void get_reqcert(const char *filename,int lnr,
const char *keyword,char **line,
int *var)
@@ -483,6 +484,7 @@ static void get_reqcert(const char *filename,int lnr,
exit(EXIT_FAILURE);
}
}
+#endif /* LDAP_OPT_X_TLS */
static void parse_krb5_ccname_statement(const char *filename,int lnr,
const char *keyword,char *line)
@@ -659,8 +661,10 @@ static void cfg_read(const char *filename,struct ldap_config *cfg)
char keyword[32];
char token[64];
int i;
+#ifdef LDAP_OPT_X_TLS
int rc;
char *value;
+#endif
/* open config file */
if ((fp=fopen(filename,"r"))==NULL)
{
diff --git a/nslcd/cfg.h b/nslcd/cfg.h
index 76b94c0..02a8152 100644
--- a/nslcd/cfg.h
+++ b/nslcd/cfg.h
@@ -28,6 +28,7 @@
#include <unistd.h>
#include <sys/types.h>
+#include <lber.h>
#include <ldap.h>
#include "compat/attrs.h"
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 9e36699..c5cd1e0 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -476,12 +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
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 */
+ ldap_set_rebind_proc(session->ld,do_rebind,session);
+ #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);
diff --git a/pam/pam.c b/pam/pam.c
index 212a5d8..4b5adfc 100644
--- a/pam/pam.c
+++ b/pam/pam.c
@@ -38,9 +38,12 @@
#define PAM_SM_SESSION
#define PAM_SM_PASSWORD
+#ifdef HAVE_SECURITY_PAM_APPL_H
+#include <security/pam_appl.h>
+#endif /* HAVE_SECURITY_PAM_APPL_H */
#ifndef HAVE_PAM_PAM_MODULES_H
#include <security/pam_modules.h>
-#else
+#else /* not HAVE_PAM_PAM_MODULES_H */
#include <pam/pam_modules.h>
#endif
@@ -53,6 +56,11 @@
#define PLD_CTX "PAM_LDAPD_CTX"
+/* some systems don't have LOG_AUTHPRIV */
+#ifndef LOG_AUTHPRIV
+#define LOG_AUTHPRIV LOG_AUTH
+#endif /* not LOG_AUTHPRIV */
+
/* this struct represents that context that the PAM module keeps
between calls */
typedef struct pld_ctx {