s3: check for PAM_RADIO_TYPE.
authorBo Yang <boyang@samba.org>
Thu, 10 Dec 2009 11:29:24 +0000 (19:29 +0800)
committerBo Yang <boyang@samba.org>
Thu, 10 Dec 2009 11:29:24 +0000 (19:29 +0800)
Signed-off-by: Bo Yang <boyang@samba.org>
nsswitch/pam_winbind.c
source3/configure.in

index 2e6520c1ce076e21995775908c889b1ac29d270f..51346a86706139fe5db9cd3568729225026e2a6f 100644 (file)
@@ -807,8 +807,7 @@ static int wbc_auth_error_to_pam_error(struct pwb_context *ctx,
        return pam_winbind_request_log(ctx, ret, username, fn);
 }
 
-/* PAM_RADIO_TYPE is linux-only. */
-#ifdef LINUX
+#if defined(HAVE_PAM_RADIO_TYPE)
 static bool _pam_winbind_change_pwd(struct pwb_context *ctx)
 {
        struct pam_message msg, *pmsg;
@@ -846,7 +845,6 @@ static bool _pam_winbind_change_pwd(struct pwb_context *ctx)
 }
 #endif
 
-
 /**
  * send a password expiry message if required
  *
index fc9e09b4afb362aa3367b96b1d83db96929c9b87..0bd10068bbe8267a0366f7fc044a5d4eeadf6860 100644 (file)
@@ -4500,6 +4500,39 @@ if test x"${try_pam}" != x"no";then
        AC_MSG_RESULT([$create_pam_modules])
 fi # try_pam != no
 
+#################################################
+# check for PAM_RADIO_TYPE
+AC_TRY_COMPILE([
+#if (!defined(LINUX))
+
+#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
+
+#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
+
+#if defined(HAVE_SECURITY__PAM_MACROS_H)
+#include <security/_pam_macros.h>
+#elif defined(HAVE_PAM__PAM_MACROS_H)
+#include <pam/_pam_macros.h>
+#endif
+
+#ifdef HAVE_SECURITY_PAM_EXT_H
+#include <security/pam_ext.h>
+#endif
+],
+[int i; i = PAM_RADIO_TYPE; ],
+AC_DEFINE(HAVE_PAM_RADIO_TYPE, 1, [Define to 1 if PAM_RADIO_TYPE is available]),[])
+
 #################################################
 # check for pam_smbpass support
 PAM_MODULES=""