From a16a56f60156b3284f9acef9a675122b36ebf7dc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 23 Aug 2010 21:00:27 +0200 Subject: s3: PAM_RHOST and PAM_TTY are enums on FreeBSD --- source3/auth/pampass.c | 6 +++--- source3/configure.in | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c index f2e30b2c63..83a3f81db0 100644 --- a/source3/auth/pampass.c +++ b/source3/auth/pampass.c @@ -494,7 +494,7 @@ static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rho return False; } -#ifdef PAM_RHOST +#if HAVE_PAM_RHOST if (rhost == NULL) { our_rhost = client_name(smbd_server_fd()); if (strequal(our_rhost,"UNKNOWN")) @@ -512,7 +512,7 @@ static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rho return False; } #endif -#ifdef PAM_TTY +#if HAVE_PAM_TTY DEBUG(4,("smb_pam_start: PAM: setting tty\n")); pam_error = pam_set_item(*pamh, PAM_TTY, "samba"); if (!smb_pam_error_handler(*pamh, pam_error, "set tty failed", 0)) { @@ -657,7 +657,7 @@ static bool smb_internal_pam_session(pam_handle_t *pamh, const char *user, const { int pam_error; -#ifdef PAM_TTY +#if HAVE_PAM_TTY DEBUG(4,("smb_internal_pam_session: PAM: tty set to: %s\n", tty)); pam_error = pam_set_item(pamh, PAM_TTY, tty); if (!smb_pam_error_handler(pamh, pam_error, "set tty failed", 0)) diff --git a/source3/configure.in b/source3/configure.in index db524d5891..02904800a3 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -4586,6 +4586,29 @@ if test x"${try_pam}" != x"no";then AC_MSG_CHECKING(whether to have PAM MODULES support) AC_MSG_RESULT([$create_pam_modules]) + + AC_TRY_COMPILE([ + #if defined(HAVE_SECURITY_PAM_APPL_H) + #include + #elif defined(HAVE_PAM_PAM_APPL_H) + #include + #endif],[ + pam_set_item(0, PAM_RHOST, 0); + ], + AC_DEFINE(HAVE_PAM_RHOST, 1, + [Define to 1 if PAM_RHOST is available]),[]) + + AC_TRY_COMPILE([ + #if defined(HAVE_SECURITY_PAM_APPL_H) + #include + #elif defined(HAVE_PAM_PAM_APPL_H) + #include + #endif],[ + pam_set_item(0, PAM_TTY, 0); + ], + AC_DEFINE(HAVE_PAM_TTY, 1, + [Define to 1 if PAM_TTY is available]),[]) + fi # try_pam != no ################################################# -- cgit