r23095: Support systems that have their PAM headers in /usr/include/pam.
authorJames Peach <jpeach@samba.org>
Wed, 23 May 2007 20:31:28 +0000 (20:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:22:45 +0000 (12:22 -0500)
(This used to be commit f1e8de4b576b3954d456cb64c02417908bab8da4)

source3/auth/pampass.c
source3/configure.in
source3/lib/pam_errors.c
source3/nsswitch/pam_winbind.h
source3/pam_smbpass/general.h
source3/pam_smbpass/pam_smb_acct.c
source3/pam_smbpass/pam_smb_auth.c
source3/pam_smbpass/pam_smb_passwd.c

index ba11d2e8fc2b52b747831746849a96d23472e625..a83e2bcb3ffbf0287e8cc94cc690c052262b0349 100644 (file)
  *   which determines what actions/limitations/allowances become affected.
  *********************************************************************/
 
+#if defined(HAVE_SECURITY_PAM_APPL_H)
 #include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include <pam/pam_appl.h>
+#endif
 
 /*
  * Structure used to communicate between the conversation function
index 92a7299c0ace8c38bc2a0d2b100a6a7d1408a7c9..3716299d9e504184a5ea07d2f21b1148cf834144 100644 (file)
@@ -4399,7 +4399,11 @@ AC_ARG_WITH(cifsmount,
 
 
 #################################################
-# check for a PAM clear-text auth, accounts, password and session support
+# Check for a PAM clear-text auth, accounts, password
+# and session support. Most PAM implementations keep their
+# headers in /usr/include/security. Darwin keeps its in
+# /usr/include/pam.
+
 with_pam_for_crypt=no
 try_pam=no
 AC_MSG_CHECKING(whether to try PAM support)
@@ -4419,10 +4423,13 @@ if test x"${try_pam}" != x"no";then
        use_pam=yes
        create_pam_modules=yes
 
-       AC_CHECK_HEADERS(security/pam_appl.h)
-       if test x"$ac_cv_header_security_pam_appl_h" != x"yes"; then
+       # Most systems have PAM headers in /usr/include/security, but Darwin
+       # has them in /usr/include/pam.
+       AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h)
+       if test x"$ac_cv_header_security_pam_appl_h" != x"yes" -a \
+               x"$ac_cv_header_pam_pam_appl_h" != x"yes"; then
                if test x"${try_pam}" = x"yes";then
-                       AC_MSG_ERROR([--with-pam=yes but security/pam_appl.h not found])
+                       AC_MSG_ERROR([--with-pam=yes but pam_appl.h not found])
                fi
                use_pam=no
                create_pam_modules=no
@@ -4437,14 +4444,18 @@ if test x"${try_pam}" != x"no";then
                create_pam_modules=no
        fi
 
-       AC_CHECK_HEADERS(security/pam_modules.h,,,[[
+       AC_CHECK_HEADERS(security/pam_modules.h pam/pam_modules.h,,,[[
                #if HAVE_SECURITY_PAM_APPL_H
                #include <security/pam_appl.h>
                #endif
+               #if HAVE_PAM_PAM_APPL_H
+               #include <pam/pam_appl.h>
+               #endif
        ]])
-       if test x"$ac_cv_header_security_pam_modules_h" = x"no"; then
+       if test x"$ac_cv_header_security_pam_modules_h" = x"no" -a \
+               x"$ac_cv_header_pam_pam_modules_h" = x"no" ; then
                if test x"${try_pam}" = x"yes";then
-                       AC_MSG_ERROR([--with-pam=yes but security/pam_modules.h not found])
+                       AC_MSG_ERROR([--with-pam=yes but pam_modules.h not found])
                fi
                create_pam_modules=no
        fi
@@ -4460,6 +4471,7 @@ if test x"${try_pam}" != x"no";then
                        # this checks are optional,
                        # we don't care about the results here
                        AC_CHECK_HEADERS(security/pam_ext.h security/_pam_macros.h)
+                       AC_CHECK_HEADERS(pam/pam_ext.h pam/_pam_macros.h)
                        AC_CHECK_FUNC_EXT(pam_vsyslog,$PAM_LIBS)
                else
                        AC_MSG_WARN([PAM support detected but PAM MODULES support is missing])          
index 9d9a377a9129b62fb924a0ca2b8f15fb5ab6691f..42931383eddb65972b5a558c65e02ee1015e40b8 100644 (file)
 #include "includes.h"
 
 #ifdef WITH_PAM
+#if defined(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(PAM_AUTHTOK_RECOVERY_ERR) && !defined(PAM_AUTHTOK_RECOVER_ERR)
 #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
index 9015869a77f427afb10661318b8a9239efd3e638..0e7688be1511b6f7061fa5a06902d1d7f7f51433 100644 (file)
 
 /* Solaris always uses dynamic pam modules */
 #define PAM_EXTERN extern
+#if defined(HAVE_SECURITY_PAM_APPL_H)
 #include <security/pam_appl.h> 
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include <pam/pam_appl.h>
+#endif
 
 #ifndef PAM_AUTHTOK_RECOVER_ERR
 #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
 
 #endif /* defined(SUNOS5) || defined(SUNOS4) || defined(HPUX) || defined(FREEBSD) || defined(AIX) */
 
-#ifdef HAVE_SECURITY_PAM_MODULES_H
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
 #include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include <pam/pam_modules.h>
 #endif
 
-#ifdef HAVE_SECURITY__PAM_MACROS_H
+#if defined(HAVE_SECURITY__PAM_MACROS_H)
 #include <security/_pam_macros.h>
+#elif defined(HAVE_PAM__PAM_MACROS_H)
+#include <pam/_pam_macros.h>
 #else
 /* Define required macros from (Linux PAM 0.68) security/_pam_macros.h */
 #define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
index f84c25444402788859345cd5213603fee91d8072..d3afb4c1fc4bae69d95aacbfe3634ead27724054 100644 (file)
@@ -1,9 +1,17 @@
 #ifndef LINUX
 /* This is only needed by modules in the Sun implementation. */
+#if defined(HAVE_SECURITY_PAM_APPL_H)
 #include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include <pam/pam_appl.h>
+#endif
 #endif  /* LINUX */
 
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
 #include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include <pam/pam_modules.h>
+#endif
 
 #ifndef PAM_AUTHTOK_RECOVER_ERR  
 #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
index 47bf0594798578e7b29c1d79e9e0fb66d9565dae..f3b20465ab5ddda1d90d47b628769f84d643a7e7 100644 (file)
 #ifndef LINUX
 
 /* This is only used in the Sun implementation. */
+#if defined(HAVE_SECURITY_PAM_APPL_H)
 #include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include <pam/pam_appl.h>
+#endif
 
 #endif  /* LINUX */
 
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
 #include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include <pam/pam_modules.h>
+#endif
 
 #include "general.h"
 
index df6d20e01ab5d53b250fd7443ea027738e02d891..ceb23c3633a8f509118568ca5e85f2bb338ce4d8 100644 (file)
 #ifndef LINUX
 
 /* This is only used in the Sun implementation. */
+#if defined(HAVE_SECURITY_PAM_APPL_H)
 #include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include <pam/pam_appl.h>
+#endif
 
 #endif  /* LINUX */
 
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
 #include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include <pam/pam_modules.h>
+#endif
 
 #include "general.h"
 
index 79bcfb6ff0f8f57536585ac330216599fdfbf205..cffee745620c84a1110915d7b8ca93e9affc8ffe 100644 (file)
    and others (including FreeBSD). */
 
 #ifndef LINUX
+#if defined(HAVE_SECURITY_PAM_APPL_H)
 #include <security/pam_appl.h>
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include <pam/pam_appl.h>
+#endif
 #endif
 
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
 #include <security/pam_modules.h>
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include <pam/pam_modules.h>
+#endif
 
 #include "general.h"