From: Sami Kerola Date: Sun, 30 Jul 2017 10:32:37 +0000 (+0100) Subject: include: move pamfail.h to auth.c X-Git-Tag: v2.31-rc1~154 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67663979328054eb9ce4f38166ee34b0dd31db7c;p=thirdparty%2Futil-linux.git 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 --- diff --git a/include/Makemodule.am b/include/Makemodule.am index 237400b056..e9b1e3021d 100644 --- a/include/Makemodule.am +++ b/include/Makemodule.am @@ -33,7 +33,6 @@ dist_noinst_HEADERS += \ include/nls.h \ include/optutils.h \ include/pager.h \ - include/pamfail.h \ include/partx.h \ include/path.h \ include/pathnames.h \ diff --git a/include/pamfail.h b/include/pamfail.h deleted file mode 100644 index bb83b9404a..0000000000 --- a/include/pamfail.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * No copyright is claimed. This code is in the public domain; do with - * it what you wish. - * - * Written by Karel Zak - */ -#ifndef UTIL_LINUX_PAMFAIL_H -#include -#ifdef HAVE_SECURITY_PAM_MISC_H -# include -#elif defined(HAVE_SECURITY_OPENPAM_H) -# include -#endif -#include "c.h" - -static inline 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; -} - -#endif /* UTIL_LINUX_PAMFAIL_H */ diff --git a/login-utils/auth.c b/login-utils/auth.c index aaf6c536b3..fdeb12bbce 100644 --- a/login-utils/auth.c +++ b/login-utils/auth.c @@ -7,8 +7,25 @@ * there is no warranty. * */ + +#include +#ifdef HAVE_SECURITY_PAM_MISC_H +# include +#elif defined(HAVE_SECURITY_OPENPAM_H) +# include +#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) {