1 /*
2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions
4 * are met:
5 * 1. Redistributions of source code must retain the above copyright
6 * notice, and the entire permission notice in its entirety,
7 * including the disclaimer of warranties.
8 * 2. Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution.
11 * 3. The name of the author may not be used to endorse or promote
12 * products derived from this software without specific prior
13 * written permission.
14 *
15 * ALTERNATIVELY, this product may be distributed under the terms of
16 * the GNU Public License, in which case the provisions of the GPL are
17 * required INSTEAD OF the above restrictions. (This clause is
18 * necessary due to a potential bad interaction between the GPL and
19 * the restrictions contained in a BSD-style copyright.)
20 *
21 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 * OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #include "pam_private.h"
35
36 const char *pam_strerror(pam_handle_t *pamh UNUSED, int errnum)
37 {
38 switch (errnum) {
39 case PAM_SUCCESS:
40 return _("Success");
41 case PAM_ABORT:
42 return _("Critical error - immediate abort");
43 case PAM_OPEN_ERR:
44 return _("Failed to load module");
45 case PAM_SYMBOL_ERR:
46 return _("Symbol not found");
47 case PAM_SERVICE_ERR:
48 return _("Error in service module");
49 case PAM_SYSTEM_ERR:
50 return _("System error");
51 case PAM_BUF_ERR:
52 return _("Memory buffer error");
53 case PAM_PERM_DENIED:
54 return _("Permission denied");
55 case PAM_AUTH_ERR:
56 return _("Authentication failure");
57 case PAM_CRED_INSUFFICIENT:
58 return _("Insufficient credentials to access authentication data");
59 case PAM_AUTHINFO_UNAVAIL:
60 return _("Authentication service cannot retrieve authentication info");
61 case PAM_USER_UNKNOWN:
62 return _("User not known to the underlying authentication module");
63 case PAM_MAXTRIES:
64 return _("Have exhausted maximum number of retries for service");
65 case PAM_NEW_AUTHTOK_REQD:
66 return _("Authentication token is no longer valid; new one required");
67 case PAM_ACCT_EXPIRED:
68 return _("User account has expired");
69 case PAM_SESSION_ERR:
70 return _("Cannot make/remove an entry for the specified session");
71 case PAM_CRED_UNAVAIL:
72 return _("Authentication service cannot retrieve user credentials");
73 case PAM_CRED_EXPIRED:
74 return _("User credentials expired");
75 case PAM_CRED_ERR:
76 return _("Failure setting user credentials");
77 case PAM_NO_MODULE_DATA:
78 return _("No module specific data is present");
79 case PAM_BAD_ITEM:
80 return _("Bad item passed to pam_*_item()");
81 case PAM_CONV_ERR:
82 return _("Conversation error");
83 case PAM_AUTHTOK_ERR:
84 return _("Authentication token manipulation error");
85 case PAM_AUTHTOK_RECOVERY_ERR:
86 return _("Authentication information cannot be recovered");
87 case PAM_AUTHTOK_LOCK_BUSY:
88 return _("Authentication token lock busy");
89 case PAM_AUTHTOK_DISABLE_AGING:
90 return _("Authentication token aging disabled");
91 case PAM_TRY_AGAIN:
92 return _("Failed preliminary check by password service");
93 case PAM_IGNORE:
94 return _("The return value should be ignored by PAM dispatch");
95 case PAM_MODULE_UNKNOWN:
96 return _("Module is unknown");
97 case PAM_AUTHTOK_EXPIRED:
98 return _("Authentication token expired");
99 case PAM_CONV_AGAIN:
100 return _("Conversation is waiting for event");
101 case PAM_INCOMPLETE:
102 return _("Application needs to call libpam again");
103 }
104
105 return _("Unknown PAM error");
106 }