netinet/in.h \
paths.h \
pty.h \
- security/pam_misc.h \
+ security/pam_appl.h \
stdint.h \
stdio_ext.h \
stdlib.h \
unistd.h \
])
+AC_CHECK_HEADERS([security/pam_misc.h],
+ [AM_CONDITIONAL([HAVE_LINUXPAM], [true])],
+ [AM_CONDITIONAL([HAVE_LINUXPAM], [false])], [
+#ifdef HAVE_SECURITY_PAM_APPL_H
+#include <security/pam_appl.h>
+#endif
+])
+
+AC_CHECK_HEADERS([security/openpam.h], [], [], [
+#ifdef HAVE_SECURITY_PAM_APPL_H
+#include <security/pam_appl.h>
+#endif
+])
+
AC_CHECK_HEADERS([langinfo.h],
[AM_CONDITIONAL([HAVE_LANGINFO], [true])],
[AM_CONDITIONAL([HAVE_LANGINFO], [false])])
have_linux_raw_h=$ac_cv_header_linux_raw_h
have_linux_securebits_h=$ac_cv_header_linux_securebits_h
have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
+have_security_pam_appl_h=$ac_cv_header_security_pam_appl_h
have_security_pam_misc_h=$ac_cv_header_security_pam_misc_h
-
+have_security_openpam_h=$ac_cv_header_security_openpam_h
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <time.h>
[], [with_ncurses=auto]
)
AM_CONDITIONAL([HAVE_NCURSES], [false])
-
AS_IF([test "x$with_ncurses" != xno], [
have_ncurses=no
UL_BUILD_INIT([chfn_chsh])
AS_IF([test "x$enable_chfn_chsh_password" = xyes -o "x$have_user" = xyes], [
- UL_REQUIRES_HAVE([chfn_chsh], [security_pam_misc_h], [PAM header file])
+ UL_REQUIRES_HAVE([chfn_chsh], [security_pam_appl_h], [PAM header file])
AC_DEFINE([CHFN_CHSH_PASSWORD], [1], [Should chfn and chsh require the user to enter the password?])
])
AM_CONDITIONAL([BUILD_CHFN_CHSH], [test "x$build_chfn_chsh" = xyes])
[], [UL_DEFAULT_ENABLE([login], [check])]
)
UL_BUILD_INIT([login])
-UL_REQUIRES_HAVE([login], [security_pam_misc_h], [PAM header file])
+UL_REQUIRES_HAVE([login], [security_pam_appl_h], [PAM header file])
+UL_REQUIRES_HAVE([login], [security_pam_misc_h, security_openpam_h], [PAM conversation functions])
AM_CONDITIONAL([BUILD_LOGIN], [test "x$build_login" = xyes])
AC_ARG_ENABLE([login-chown-vcs],
[], [UL_DEFAULT_ENABLE([su], [check])]
)
UL_BUILD_INIT([su])
-UL_REQUIRES_HAVE([su], [security_pam_misc_h], [PAM header file])
+UL_REQUIRES_HAVE([su], [security_pam_appl_h], [PAM header file])
AM_CONDITIONAL([BUILD_SU], [test "x$build_su" = xyes])
[], [UL_DEFAULT_ENABLE([runuser], [check])]
)
UL_BUILD_INIT([runuser])
-UL_REQUIRES_HAVE([runuser], [security_pam_misc_h], [PAM header file])
+UL_REQUIRES_HAVE([runuser], [security_pam_appl_h], [PAM header file])
AM_CONDITIONAL([BUILD_RUNUSER], [test "x$build_runuser" = xyes])
*/
#ifndef UTIL_LINUX_PAMFAIL_H
#include <security/pam_appl.h>
-#include <security/pam_misc.h>
+#ifdef HAVE_SECURITY_PAM_MISC_H
+# include <security/pam_misc.h>
+#elif defined(HAVE_SECURITY_OPENPAM_H)
+# include <security/openpam.h>
+#endif
#include "c.h"
static inline int
login-utils/login.c \
login-utils/logindefs.c \
login-utils/logindefs.h
-login_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
+login_LDADD = $(LDADD) libcommon.la -lpam
+if HAVE_LINUXPAM
+login_LDADD += -lpam_misc
+endif
if HAVE_AUDIT
login_LDADD += -laudit
endif
chfn_chsh_ldadd = libcommon.la
if CHFN_CHSH_PASSWORD
-chfn_chsh_ldadd += -lpam -lpam_misc
+chfn_chsh_ldadd += -lpam
+if HAVE_LINUXPAM
+chfn_chsh_ldadd += -lpam_misc
+endif
chfn_chsh_sources += \
login-utils/auth.c \
login-utils/auth.h
-endif
+endif # CHFN_CHSH_PASSWORD
if HAVE_USER
chfn_chsh_ldflags += $(LIBUSER_LIBS)
login-utils/logindefs.h
su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
-su_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
+su_LDADD = $(LDADD) libcommon.la -lpam
+if HAVE_LINUXPAM
+su_LDADD += -lpam_misc
endif
+endif # BUILD_SU
if BUILD_RUNUSER
login-utils/su-common.h \
login-utils/logindefs.c \
login-utils/logindefs.h
-runuser_LDADD = $(LDADD) libcommon.la -lpam -lpam_misc
+runuser_LDADD = $(LDADD) libcommon.la -lpam
+if HAVE_LINUXPAM
+runuser_LDADD += -lpam_misc
endif
+endif # BUILD_RUNUSER
if BUILD_NEWGRP
* there is no warranty.
*
*/
-
#include "auth.h"
#include "pamfail.h"
{
if (uid != 0) {
pam_handle_t *pamh = NULL;
+#ifdef HAVE_SECURITY_PAM_MISC_H
struct pam_conv conv = { misc_conv, NULL };
+#elif defined(HAVE_SECURITY_OPENPAM_H)
+ struct pam_conv conv = { openpam_ttyconv, NULL };
+#endif
int retcode;
retcode = pam_start(service_name, username, &conv, &pamh);
#include <netdb.h>
#include <lastlog.h>
#include <security/pam_appl.h>
-#include <security/pam_misc.h>
+#ifdef HAVE_SECURITY_PAM_MISC_H
+# include <security/pam_misc.h>
+#elif defined(HAVE_SECURITY_OPENPAM_H)
+# include <security/openpam.h>
+#endif
#include <sys/sendfile.h>
#ifdef HAVE_LIBAUDIT
struct passwd *pwd = NULL, _pwd;
struct login_context cxt = {
- .tty_mode = TTY_MODE, /* tty chmod() */
- .pid = getpid(), /* PID */
- .conv = { misc_conv, NULL } /* PAM conversation function */
+ .tty_mode = TTY_MODE, /* tty chmod() */
+ .pid = getpid(), /* PID */
+#ifdef HAVE_SECURITY_PAM_MISC_H
+ .conv = { misc_conv, NULL } /* Linux-PAM conversation function */
+#elif defined(HAVE_SECURITY_OPENPAM_H)
+ .conv = { openpam_ttyconv, NULL } /* OpenPAM conversation function */
+#endif
+
};
timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT);
#include <pwd.h>
#include <grp.h>
#include <security/pam_appl.h>
-#include <security/pam_misc.h>
+#ifdef HAVE_SECURITY_PAM_MISC_H
+# include <security/pam_misc.h>
+#elif defined(HAVE_SECURITY_OPENPAM_H)
+# include <security/openpam.h>
+#endif
#include <signal.h>
#include <sys/wait.h>
#include <syslog.h>
&& msg
&& msg[0]->msg_style == PAM_TEXT_INFO)
return PAM_SUCCESS;
-
+#ifdef HAVE_SECURITY_PAM_MISC_H
return misc_conv(num_msg, msg, resp, appdata_ptr);
+#elif defined(HAVE_SECURITY_OPENPAM_H)
+ return openpam_ttyconv(num_msg, msg, resp, appdata_ptr);
+#endif
}
static struct pam_conv conv =