]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/pamfail.h
libfdisk: (dos) accept start for log.partitions on template
[thirdparty/util-linux.git] / include / pamfail.h
1 /*
2 * No copyright is claimed. This code is in the public domain; do with
3 * it what you wish.
4 *
5 * Written by Karel Zak <kzak@redhat.com>
6 */
7 #ifndef UTIL_LINUX_PAMFAIL_H
8 #include <security/pam_appl.h>
9 #ifdef HAVE_SECURITY_PAM_MISC_H
10 # include <security/pam_misc.h>
11 #elif defined(HAVE_SECURITY_OPENPAM_H)
12 # include <security/openpam.h>
13 #endif
14 #include "c.h"
15
16 static inline int
17 pam_fail_check(pam_handle_t *pamh, int retcode)
18 {
19 if (retcode == PAM_SUCCESS)
20 return 0;
21 warnx("%s", pam_strerror(pamh, retcode));
22 pam_end(pamh, retcode);
23 return 1;
24 }
25
26 #endif /* UTIL_LINUX_PAMFAIL_H */