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 $
5 * $DragonFly: src/contrib/libpam/libpam/Attic/pam_strerror.c,v 1.2 2003/06/17 04:24:03 dillon Exp $
7 * $Log: pam_strerror.c,v $
8 * Revision 1.6 1997/01/04 20:12:02 morgan
9 * replaced conditional FAIL_NOW with ABORT
11 * Revision 1.5 1996/07/07 23:58:56 morgan
12 * corrected "... " to "..."
14 * Revision 1.4 1996/06/02 08:03:29 morgan
17 * Revision 1.3 1996/03/16 23:08:54 morgan
18 * PAM --> Linux-PAM ;)
22 #include "pam_private.h"
24 const char *pam_strerror(pam_handle_t *pamh, int errnum)
26 #ifdef UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT /* will be removed from v 1.0 */
30 possible_error = (int) pamh;
31 if (!(possible_error >= 0 && possible_error <= PAM_BAD_ITEM)) {
32 possible_error = errnum;
35 /* mask standard behavior to use possible_error variable. */
36 #define errnum possible_error
38 #endif /* UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT */
44 return "Critical error - immediate abort";
46 return "dlopen() failure";
48 return "Symbol not found";
50 return "Error in service module";
52 return "System error";
54 return "Memory buffer error";
56 return "Permission denied";
58 return "Authentication failure";
59 case PAM_CRED_INSUFFICIENT:
60 return "Insufficient credentials to access authentication data";
61 case PAM_AUTHINFO_UNAVAIL:
62 return "Authentication service cannot retrieve authentication info.";
63 case PAM_USER_UNKNOWN:
64 return "User not known to the underlying authentication module";
66 return "Have exhasted maximum number of retries for service.";
67 case PAM_NEW_AUTHTOK_REQD:
68 return "Authentication token is no longer valid; new one required.";
69 case PAM_ACCT_EXPIRED:
70 return "User account has expired";
72 return "Cannot make/remove an entry for the specified session";
73 case PAM_CRED_UNAVAIL:
74 return "Authentication service cannot retrieve user credentials";
75 case PAM_CRED_EXPIRED:
76 return "User credentials expired";
78 return "Failure setting user credentials";
79 case PAM_NO_MODULE_DATA:
80 return "No module specific data is present";
82 return "Bad item passed to pam_*_item()";
84 return "Conversation error";
86 return "Authentication token manipulation error";
87 case PAM_AUTHTOK_RECOVER_ERR:
88 return "Authentication information cannot be recovered";
89 case PAM_AUTHTOK_LOCK_BUSY:
90 return "Authentication token lock busy";
91 case PAM_AUTHTOK_DISABLE_AGING:
92 return "Authentication token aging disabled";
94 return "Failed preliminary check by password service";
96 return "Please ignore underlying account module";
97 case PAM_MODULE_UNKNOWN:
98 return "Module is unknown";
99 case PAM_AUTHTOK_EXPIRED:
100 return "Authentication token expired";
102 return "Conversation is waiting for event";
104 return "Application needs to call libpam again";
107 return "Unknown Linux-PAM error (need to upgrde libpam?)";