diff --git a/config.h.in b/config.h.in index 4e0a7290c..dca0786c0 100644 --- a/config.h.in +++ b/config.h.in @@ -375,6 +375,9 @@ /* Define to 1 if you use PAM authentication. */ #undef HAVE_PAM +/* Define to 1 if you have the `pam_getenvlist' function. */ +#undef HAVE_PAM_GETENVLIST + /* Define to 1 if you use a specific PAM session for sudo -i. */ #undef HAVE_PAM_LOGIN diff --git a/configure b/configure index 5ba3c903c..a9f7791ce 100755 --- a/configure +++ b/configure @@ -18228,6 +18228,22 @@ done fi if test "$with_pam" = "yes"; then + # Older PAM implementations lack pam_getenvlist + OLIBS="$LIBS" + LIBS="$LIBS -lpam $lt_cv_dlopen_libs" + for ac_func in pam_getenvlist +do : + ac_fn_c_check_func "$LINENO" "pam_getenvlist" "ac_cv_func_pam_getenvlist" +if test "x$ac_cv_func_pam_getenvlist" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PAM_GETENVLIST 1 +_ACEOF + +fi +done + + LIBS="$OLIBS" + # We already link with -ldl if needed (see LIBDL below) SUDOERS_LIBS="${SUDOERS_LIBS} -lpam" $as_echo "#define HAVE_PAM 1" >>confdefs.h diff --git a/configure.in b/configure.in index 124d7813d..1673f74d9 100644 --- a/configure.in +++ b/configure.in @@ -2569,6 +2569,12 @@ if test ${with_pam-"no"} != "no"; then fi if test "$with_pam" = "yes"; then + # Older PAM implementations lack pam_getenvlist + OLIBS="$LIBS" + LIBS="$LIBS -lpam $lt_cv_dlopen_libs" + AC_CHECK_FUNCS(pam_getenvlist) + LIBS="$OLIBS" + # We already link with -ldl if needed (see LIBDL below) SUDOERS_LIBS="${SUDOERS_LIBS} -lpam" AC_DEFINE(HAVE_PAM)