summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaul <paul>2003-05-06 12:16:27 +0000
committerpaul <paul>2003-05-06 12:16:27 +0000
commit24cd435b1a24f8243da69dafa01286525f08291c (patch)
tree4476005d79f636550e826773a58a2784cdcf5b99
parenta805cc2d7030694ae2ae38403452ac3b90a40cff (diff)
From: Sergiy Vyshnevetskiy <serg@vostok.net>
Subject: [zebra 18947] [PATCH] openpam patch configure support for openpam (freebsd5.0)
-rwxr-xr-xconfigure.ac31
-rw-r--r--vtysh/vtysh_user.c7
2 files changed, 35 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c8460c12..6a0cf3b6 100755
--- a/configure.ac
+++ b/configure.ac
@@ -224,6 +224,33 @@ dnl ----------
dnl PAM module
dnl ----------
if test "$with_libpam" = "yes"; then
+ AC_MSG_CHECKING(security/pam_misc.h)
+ AC_CHECK_HEADER(security/pam_misc.h)
+ if test "$ac_cv_header_security_pam_misc_h" = yes; then
+ AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
+ AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
+ pam_conv_func="misc_conv"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ AC_MSG_CHECKING(security/openpam.h)
+ AC_CHECK_HEADER(security/openpam.h)
+ if test "$ac_cv_header_security_openpam_h" = yes; then
+ AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
+ AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
+ pam_conv_func="openpam_ttyconv"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
+ AC_MSG_WARN([*** pam support will not be built ***])
+ with_libpam="no"
+ fi
+fi
+
+if test "$with_libpam" = "yes"; then
dnl took this test from proftpd's configure.in and suited to our needs
dnl -------------------------------------------------------------------------
dnl
@@ -232,7 +259,7 @@ dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
dnl omitted requiring libdl linking information. PAM-0.72 or better ships
dnl with RedHat 6.2 and Debian 2.2 or better.
AC_CHECK_LIB(pam, pam_start,
- [AC_CHECK_LIB(pam, misc_conv,
+ [AC_CHECK_LIB(pam, $pam_conv_func,
[AC_DEFINE(USE_PAM,,Use PAM for authentication)
LIBPAM="-lpam"],
[AC_DEFINE(USE_PAM,,Use PAM for authentication)
@@ -241,7 +268,7 @@ AC_CHECK_LIB(pam, pam_start,
],
[AC_CHECK_LIB(pam, pam_end,
- [AC_CHECK_LIB(pam, misc_conv,
+ [AC_CHECK_LIB(pam, $pam_conv_func,
[AC_DEFINE(USE_PAM)
LIBPAM="-lpam -ldl"],
[AC_DEFINE(USE_PAM)
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index b84da2eb..ecbe0f4c 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -25,7 +25,12 @@
#ifdef USE_PAM
#include <security/pam_appl.h>
+#ifdef HAVE_PAM_MISC_H
#include <security/pam_misc.h>
+#endif
+#ifdef HAVE_OPENPAM_H
+#include <security/openpam.h>
+#endif
#endif /* USE_PAM */
#include "memory.h"
@@ -35,7 +40,7 @@
#ifdef USE_PAM
static struct pam_conv conv =
{
- misc_conv,
+ PAM_CONV_FUNC,
NULL
};