diff options
author | Will Johansson | 2014-12-10 03:40:31 +0100 |
---|---|---|
committer | Karel Zak | 2014-12-15 10:16:03 +0100 |
commit | fe2c9909cd127b5be0f103b8e633807c6afde000 (patch) | |
tree | 6d6b9b36aa0e9884a3785303cbe06a79b6a15c31 /login-utils/su-common.c | |
parent | lslogins: fix -l -g logic (diff) | |
download | kernel-qcow2-util-linux-fe2c9909cd127b5be0f103b8e633807c6afde000.tar.gz kernel-qcow2-util-linux-fe2c9909cd127b5be0f103b8e633807c6afde000.tar.xz kernel-qcow2-util-linux-fe2c9909cd127b5be0f103b8e633807c6afde000.zip |
login-utils: Enable building util-linux against OpenPAM
OpenPAM is compatible with util-linux, with a few changes, namely
using OpenPAM's conversation function, openpam_ttyconv.
We check for Linux-PAM by querying for security/pam_misc.h, and OpenPAM
by querying for security/openpam.h.
Signed-off-by: Will Johansson <will.johansson@gmail.com>
Diffstat (limited to 'login-utils/su-common.c')
-rw-r--r-- | login-utils/su-common.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/login-utils/su-common.c b/login-utils/su-common.c index eb3b844be..57038ce37 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -50,7 +50,11 @@ enum #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> @@ -220,8 +224,11 @@ static int su_pam_conv(int num_msg, const struct pam_message **msg, && 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 = |