diff options
author | Sami Kerola | 2017-07-30 12:32:37 +0200 |
---|---|---|
committer | Sami Kerola | 2017-08-05 10:58:18 +0200 |
commit | 67663979328054eb9ce4f38166ee34b0dd31db7c (patch) | |
tree | 1779d6f4290e62af44404594050f5b98abb0d5b2 /login-utils/auth.c | |
parent | libblkid: add support for UBI superblock (diff) | |
download | kernel-qcow2-util-linux-67663979328054eb9ce4f38166ee34b0dd31db7c.tar.gz kernel-qcow2-util-linux-67663979328054eb9ce4f38166ee34b0dd31db7c.tar.xz kernel-qcow2-util-linux-67663979328054eb9ce4f38166ee34b0dd31db7c.zip |
include: move pamfail.h to auth.c
This removes one small header file, and makes inline function to static to
only file it is used in.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/auth.c')
-rw-r--r-- | login-utils/auth.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/login-utils/auth.c b/login-utils/auth.c index aaf6c536b..fdeb12bbc 100644 --- a/login-utils/auth.c +++ b/login-utils/auth.c @@ -7,8 +7,25 @@ * there is no warranty. * */ + +#include <security/pam_appl.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" #include "auth.h" -#include "pamfail.h" + +static int pam_fail_check(pam_handle_t *pamh, int retcode) +{ + if (retcode == PAM_SUCCESS) + return 0; + warnx("%s", pam_strerror(pamh, retcode)); + pam_end(pamh, retcode); + return 1; +} int auth_pam(const char *service_name, uid_t uid, const char *username) { |