blob: e102df227d6793ca6b5d43b7eb48397504e40cd2 [file] [log] [blame]
bigbiff bigbiffe60683a2013-02-22 20:55:50 -05001/*
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#include <security/pam_misc.h>
10#include "c.h"
11
12static inline int
13pam_fail_check(pam_handle_t *pamh, int retcode)
14{
15 if (retcode == PAM_SUCCESS)
16 return 0;
17 warnx("%s", pam_strerror(pamh, retcode));
18 pam_end(pamh, retcode);
19 return 1;
20}
21
22#endif /* UTIL_LINUX_PAMFAIL_H */