diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-11-02 20:15:39 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-11-02 20:15:39 +0400 |
commit | b13154de3eca5ba28fbb4854d916cd0be5febeed (patch) | |
tree | 30f2e9e89ab71a2df837076ac68c3ba770230294 /include/pamfail.h | |
download | util-linux-upstream.tar.gz |
Imported Upstream version 2.22upstream/2.22upstream
Diffstat (limited to 'include/pamfail.h')
-rw-r--r-- | include/pamfail.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/pamfail.h b/include/pamfail.h new file mode 100644 index 0000000..8008ce3 --- /dev/null +++ b/include/pamfail.h @@ -0,0 +1,16 @@ +#ifndef UTIL_LINUX_PAMFAIL_H +#include <security/pam_appl.h> +#include <security/pam_misc.h> +#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 */ |