3 /* $Id: pam_strerror.c,v 1.6 1997/01/04 20:12:02 morgan Exp morgan $
4 * $FreeBSD: src/contrib/libpam/libpam/pam_strerror.c,v 1.1.1.1.6.2 2001/06/11 15:28:12 markm Exp $
6 * $Log: pam_strerror.c,v $
7 * Revision 1.6 1997/01/04 20:12:02 morgan
8 * replaced conditional FAIL_NOW with ABORT
10 * Revision 1.5 1996/07/07 23:58:56 morgan
11 * corrected "... " to "..."
13 * Revision 1.4 1996/06/02 08:03:29 morgan
16 * Revision 1.3 1996/03/16 23:08:54 morgan
17 * PAM --> Linux-PAM ;)
21 #include "pam_private.h"
23 const char *pam_strerror(pam_handle_t *pamh, int errnum)
25 #ifdef UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT /* will be removed from v 1.0 */
29 possible_error = (int) pamh;
30 if (!(possible_error >= 0 && possible_error <= PAM_BAD_ITEM)) {
31 possible_error = errnum;
34 /* mask standard behavior to use possible_error variable. */
35 #define errnum possible_error
37 #endif /* UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT */
43 return "Critical error - immediate abort";
45 return "dlopen() failure";
47 return "Symbol not found";
49 return "Error in service module";
51 return "System error";
53 return "Memory buffer error";
55 return "Permission denied";
57 return "Authentication failure";
58 case PAM_CRED_INSUFFICIENT:
59 return "Insufficient credentials to access authentication data";
60 case PAM_AUTHINFO_UNAVAIL:
61 return "Authentication service cannot retrieve authentication info.";
62 case PAM_USER_UNKNOWN:
63 return "User not known to the underlying authentication module";
65 return "Have exhasted maximum number of retries for service.";
66 case PAM_NEW_AUTHTOK_REQD:
67 return "Authentication token is no longer valid; new one required.";
68 case PAM_ACCT_EXPIRED:
69 return "User account has expired";
71 return "Cannot make/remove an entry for the specified session";
72 case PAM_CRED_UNAVAIL:
73 return "Authentication service cannot retrieve user credentials";
74 case PAM_CRED_EXPIRED:
75 return "User credentials expired";
77 return "Failure setting user credentials";
78 case PAM_NO_MODULE_DATA:
79 return "No module specific data is present";
81 return "Bad item passed to pam_*_item()";
83 return "Conversation error";
85 return "Authentication token manipulation error";
86 case PAM_AUTHTOK_RECOVER_ERR:
87 return "Authentication information cannot be recovered";
88 case PAM_AUTHTOK_LOCK_BUSY:
89 return "Authentication token lock busy";
90 case PAM_AUTHTOK_DISABLE_AGING:
91 return "Authentication token aging disabled";
93 return "Failed preliminary check by password service";
95 return "Please ignore underlying account module";
96 case PAM_MODULE_UNKNOWN:
97 return "Module is unknown";
98 case PAM_AUTHTOK_EXPIRED:
99 return "Authentication token expired";
101 return "Conversation is waiting for event";
103 return "Application needs to call libpam again";
106 return "Unknown Linux-PAM error (need to upgrde libpam?)";