Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2017-06-16 18:31:52 +0200
committerArthur de Jong <arthur@arthurdejong.org>2017-06-16 18:41:19 +0200
commit3d5ab890d3377eb1c344e69992252bebec8a29e6 (patch)
tree16b5a37b2b2ecae7bbe78cc38be4ad3e0b2b7767 /configure.ac
parentb5d1dd2196e470c5c67bfda00b776346f95b928c (diff)
Fix pam_info() and pam_error() replacement
On FreeBSD these are functions while on Linux they are macros causing them to be incorrectly replaced on FreeBSD. This resulted in a crash of the PAM module when e.g. presenting messages about password expiry.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 34d42d1..564f9c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -606,6 +606,21 @@ then
# replace some PAM functions if they are unavailable
AC_REPLACE_FUNCS(pam_get_authtok pam_prompt)
AC_CHECK_FUNCS(pam_modutil_getpwnam pam_syslog)
+ AC_CHECK_DECLS([pam_info, pam_error],,, [
+ #ifdef HAVE_SECURITY_PAM_APPL_H
+ #include <security/pam_appl.h>
+ #endif
+ #ifndef HAVE_PAM_PAM_MODULES_H
+ #include <security/pam_modules.h>
+ #ifdef HAVE_SECURITY_PAM_EXT_H
+ #include <security/pam_ext.h>
+ #endif
+ #else
+ #include <pam/pam_modules.h>
+ #endif
+ #ifdef HAVE_SECURITY_PAM_MODUTIL_H
+ #include <security/pam_modutil.h>
+ #endif])
# find out how to link the library
pam_ldap_so_LINK="\$(CCLD) \$(AM_CFLAGS) \$(CFLAGS) \$(pam_ldap_so_LDFLAGS) \$(LDFLAGS) -o \$@"