changeset 706:df5bf4ee669f HEAD

OSX puts PAM includes into pam/ directory instead of security. Detect that.
author Timo Sirainen <tss@iki.fi>
date Tue, 26 Nov 2002 22:55:44 +0200
parents b1bec95ecde3
children 09c01325e070
files acconfig.h configure.in src/auth/userinfo-pam.c
diffstat 3 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/acconfig.h	Tue Nov 26 22:35:47 2002 +0200
+++ b/acconfig.h	Tue Nov 26 22:55:44 2002 +0200
@@ -30,8 +30,11 @@
 #undef USERINFO_PAM
 #undef USERINFO_VPOPMAIL
 
+/* PAM stuff */
 #undef AUTH_PAM_USERPASS
 #undef HAVE_PAM_SETCRED
+#undef HAVE_SECURITY_PAM_APPL_H
+#undef HAVE_PAM_PAM_APPL_H
 
 /* How to implement I/O loop */
 #undef IOLOOP_SELECT
--- a/configure.in	Tue Nov 26 22:35:47 2002 +0200
+++ b/configure.in	Tue Nov 26 22:55:44 2002 +0200
@@ -471,7 +471,18 @@
 
 if test $want_pam = yes; then
 	AC_CHECK_LIB(pam, pam_start, [
+		have_pam=no
 		AC_CHECK_HEADER(security/pam_appl.h, [
+			AC_DEFINE(HAVE_SECURITY_PAM_APPL_H)
+			have_pam=yes
+		])
+
+		AC_CHECK_HEADER(pam/pam_appl.h, [
+			AC_DEFINE(HAVE_PAM_PAM_APPL_H)
+			have_pam=yes
+		])
+
+		if test "$have_pam" = "yes"; then
 			USERINFO_LIBS="$USERINFO_LIBS -lpam"
 			AC_DEFINE(USERINFO_PAM)
 			auths="$auths pam"
@@ -479,7 +490,7 @@
 			AC_CHECK_LIB(pam, pam_setcred, [
 				AC_DEFINE(HAVE_PAM_SETCRED)
 			])
-		])
+		fi
 	])
 fi
 
--- a/src/auth/userinfo-pam.c	Tue Nov 26 22:35:47 2002 +0200
+++ b/src/auth/userinfo-pam.c	Tue Nov 26 22:55:44 2002 +0200
@@ -15,7 +15,11 @@
 #include "userinfo-passwd.h"
 
 #include <stdlib.h>
-#include <security/pam_appl.h>
+#ifdef HAVE_SECURITY_PAM_APPL_H
+#  include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#  include <pam/pam_appl.h>
+#endif
 
 #if !defined(_SECURITY_PAM_APPL_H) && !defined(LINUX_PAM)
 /* Sun's PAM doesn't use const. we use a bit dirty hack to check it.