From cd6a30022299282633ccec7ea3f7cb358369c876 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 31 Aug 2008 17:27:16 +0000 Subject: [PATCH] * configure.in, src/login.c: Do not use HAVE_PAM_FAIL_DELAY, but HAS_PAM_FAIL_DELAY, to avoid a redefinition with Linux PAM. --- ChangeLog | 2 ++ configure.in | 6 ++++-- src/login.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d26bc0c..32fa5498 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2008-08-28 Nicolas François * configure.in: Indentation fix. + * configure.in, src/login.c: Do not use HAVE_PAM_FAIL_DELAY, but + HAS_PAM_FAIL_DELAY, to avoid a redefinition with Linux PAM. 2008-08-27 Nicolas François diff --git a/configure.in b/configure.in index 3626c722..5e6151be 100644 --- a/configure.in +++ b/configure.in @@ -389,8 +389,10 @@ if test "$with_libpam" = "yes"; then save_libs=$LIBS - LIBS="$LIBS $LIBPAM" - AC_CHECK_FUNCS([pam_fail_delay]) + LIBS="$LIBS $LIBPAM" + # We do not use AC_CHECK_FUNCS to avoid duplicated definition with + # Linux PAM. + AC_CHECK_FUNC(pam_fail_delay, [AC_DEFINE(HAS_PAM_FAIL_DELAY, 1, [Define to 1 if you have the declaration of 'pam_fail_delay'])]) LIBS=$save_libs AC_DEFINE(USE_PAM, 1, [Define to support Pluggable Authentication Modules]) diff --git a/src/login.c b/src/login.c index 3ed3feb6..f2f6346e 100644 --- a/src/login.c +++ b/src/login.c @@ -645,7 +645,7 @@ int main (int argc, char **argv) PAM_FAIL_CHECK; retcode = pam_set_item (pamh, PAM_TTY, tty); PAM_FAIL_CHECK; -#ifdef HAVE_PAM_FAIL_DELAY +#ifdef HAS_PAM_FAIL_DELAY retcode = pam_fail_delay (pamh, 1000000 * delay); PAM_FAIL_CHECK; #endif @@ -691,7 +691,7 @@ int main (int argc, char **argv) failed = false; failcount++; -#ifdef HAVE_PAM_FAIL_DELAY +#ifdef HAS_PAM_FAIL_DELAY if (delay > 0) { retcode = pam_fail_delay(pamh, 1000000*delay); }