commit 3d72c96d125a9dd048cc9c358b01aa354a5afa66
Author: Bo Yang <boyang@samba.org>
Date:   Thu Dec 10 19:29:24 2009 +0800

    s3: check for PAM_RADIO_TYPE.
    
    Signed-off-by: Bo Yang <boyang@samba.org>
    (cherry picked from commit c7e3a2dc319cc6504356be7fa7970917404a69b5)

Index: nsswitch/pam_winbind.c
===================================================================
--- nsswitch/pam_winbind.c.orig
+++ nsswitch/pam_winbind.c
@@ -803,8 +803,7 @@ static int wbc_auth_error_to_pam_error(s
 	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;
@@ -842,7 +841,6 @@ static bool _pam_winbind_change_pwd(stru
 }
 #endif
 
-
 /**
  * send a password expiry message if required
  *
Index: source3/configure.in
===================================================================
--- source3/configure.in.orig
+++ source3/configure.in
@@ -4204,6 +4204,39 @@ if test x"${try_pam}" != x"no";then
 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=""
 INSTALL_PAM_MODULES=""
