~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to Linux-PAM/libpam/pam_strerror.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* pam_strerror.c */
 
2
 
 
3
/*
 
4
 * $Id: pam_strerror.c,v 1.1.1.2 2002/09/15 20:08:39 hartmans Exp $
 
5
 */
 
6
 
 
7
#include "pam_private.h"
 
8
 
 
9
const char *pam_strerror(pam_handle_t *pamh, int errnum)
 
10
{
 
11
#ifdef UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT  /* will be removed from v 1.0 */
 
12
 
 
13
    int possible_error;
 
14
 
 
15
    possible_error = (int) pamh;
 
16
    if (!(possible_error >= 0 && possible_error <= PAM_BAD_ITEM)) {
 
17
        possible_error = errnum;
 
18
    }
 
19
 
 
20
/* mask standard behavior to use possible_error variable. */
 
21
#define errnum possible_error
 
22
 
 
23
#endif /* UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT */
 
24
 
 
25
    switch (errnum) {
 
26
    case PAM_SUCCESS:
 
27
        return "Success";
 
28
    case PAM_ABORT:
 
29
        return "Critical error - immediate abort";
 
30
    case PAM_OPEN_ERR:
 
31
        return "dlopen() failure";
 
32
    case PAM_SYMBOL_ERR:
 
33
        return "Symbol not found";
 
34
    case PAM_SERVICE_ERR:
 
35
        return "Error in service module";
 
36
    case PAM_SYSTEM_ERR:
 
37
        return "System error";
 
38
    case PAM_BUF_ERR:
 
39
        return "Memory buffer error";
 
40
    case PAM_PERM_DENIED:
 
41
        return "Permission denied";
 
42
    case PAM_AUTH_ERR:
 
43
        return "Authentication failure";
 
44
    case PAM_CRED_INSUFFICIENT:
 
45
        return "Insufficient credentials to access authentication data";
 
46
    case PAM_AUTHINFO_UNAVAIL:
 
47
        return "Authentication service cannot retrieve authentication info.";
 
48
    case PAM_USER_UNKNOWN:
 
49
        return "User not known to the underlying authentication module";
 
50
    case PAM_MAXTRIES:
 
51
        return "Have exhasted maximum number of retries for service.";
 
52
    case PAM_NEW_AUTHTOK_REQD:
 
53
        return "Authentication token is no longer valid; new one required.";
 
54
    case PAM_ACCT_EXPIRED:
 
55
        return "User account has expired";
 
56
    case PAM_SESSION_ERR:
 
57
        return "Cannot make/remove an entry for the specified session";
 
58
    case PAM_CRED_UNAVAIL:
 
59
        return "Authentication service cannot retrieve user credentials";
 
60
    case PAM_CRED_EXPIRED:
 
61
        return "User credentials expired";
 
62
    case PAM_CRED_ERR:
 
63
        return "Failure setting user credentials";
 
64
    case PAM_NO_MODULE_DATA:
 
65
        return "No module specific data is present";
 
66
    case PAM_BAD_ITEM:
 
67
        return "Bad item passed to pam_*_item()";
 
68
    case PAM_CONV_ERR:
 
69
        return "Conversation error";
 
70
    case PAM_AUTHTOK_ERR:
 
71
        return "Authentication token manipulation error";
 
72
    case PAM_AUTHTOK_RECOVER_ERR:
 
73
        return "Authentication information cannot be recovered";
 
74
    case PAM_AUTHTOK_LOCK_BUSY:
 
75
        return "Authentication token lock busy";
 
76
    case PAM_AUTHTOK_DISABLE_AGING:
 
77
        return "Authentication token aging disabled";
 
78
    case PAM_TRY_AGAIN:
 
79
        return "Failed preliminary check by password service";
 
80
    case PAM_IGNORE:
 
81
        return "Please ignore underlying account module";
 
82
    case PAM_MODULE_UNKNOWN:
 
83
        return "Module is unknown";
 
84
    case PAM_AUTHTOK_EXPIRED:
 
85
        return "Authentication token expired";
 
86
    case PAM_CONV_AGAIN:
 
87
        return "Conversation is waiting for event";
 
88
    case PAM_INCOMPLETE:
 
89
        return "Application needs to call libpam again";
 
90
    }
 
91
 
 
92
    return "Unknown PAM error";
 
93
}