bigbiff bigbiff | e60683a | 2013-02-22 20:55:50 -0500 | [diff] [blame] | 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> |
bigbiff | 7b4c7a6 | 2015-01-01 19:44:14 -0500 | [diff] [blame] | 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 |
bigbiff bigbiff | e60683a | 2013-02-22 20:55:50 -0500 | [diff] [blame] | 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 */ |