1PAM_GET_ITEM(3) Linux-PAM Manual PAM_GET_ITEM(3)
2
3
4
6 pam_get_item - getting PAM informations
7
9 #include <security/pam_modules.h>
10
11 int pam_get_item(const pam_handle_t *pamh, int item_type,
12 const void **item);
13
15 The pam_get_item function allows applications and PAM service modules
16 to access and retrieve PAM informations of item_type. Upon successful
17 return, item contains a pointer to the value of the corresponding item.
18 Note, this is a pointer to the actual data and should not be free()'ed
19 or over-written! The following values are supported for item_type:
20
21 PAM_SERVICE
22 The service name (which identifies that PAM stack that the PAM
23 functions will use to authenticate the program).
24
25 PAM_USER
26 The username of the entity under whose identity service will be
27 given. That is, following authentication, PAM_USER identifies the
28 local entity that gets to use the service. Note, this value can be
29 mapped from something (eg., "anonymous") to something else (eg.
30 "guest119") by any module in the PAM stack. As such an application
31 should consult the value of PAM_USER after each call to a PAM
32 function.
33
34 PAM_USER_PROMPT
35 The string used when prompting for a user's name. The default value
36 for this string is a localized version of "login: ".
37
38 PAM_TTY
39 The terminal name: prefixed by /dev/ if it is a device file; for
40 graphical, X-based, applications the value for this item should be
41 the $DISPLAY variable.
42
43 PAM_RUSER
44 The requesting user name: local name for a locally requesting user
45 or a remote user name for a remote requesting user.
46
47 Generally an application or module will attempt to supply the value
48 that is most strongly authenticated (a local account before a remote
49 one. The level of trust in this value is embodied in the actual
50 authentication stack associated with the application, so it is
51 ultimately at the discretion of the system administrator.
52
53
54 PAM_RUSER@PAM_RHOST should always identify the requesting user. In
55 some cases, PAM_RUSER may be NULL. In such situations, it is unclear
56 who the requesting entity is.
57
58 PAM_RHOST
59 The requesting hostname (the hostname of the machine from which the
60 PAM_RUSER entity is requesting service). That is PAM_RUSER@PAM_RHOST
61 does identify the requesting user. In some applications, PAM_RHOST
62 may be NULL. In such situations, it is unclear where the
63 authentication request is originating from.
64
65 PAM_AUTHTOK
66 The authentication token (often a password). This token should be
67 ignored by all module functions besides pam_sm_authenticate(3) and
68 pam_sm_chauthtok(3). In the former function it is used to pass the
69 most recent authentication token from one stacked module to another.
70 In the latter function the token is used for another purpose. It
71 contains the currently active authentication token.
72
73 PAM_OLDAUTHTOK
74 The old authentication token. This token should be ignored by all
75 module functions except pam_sm_chauthtok(3).
76
77 PAM_CONV
78 The pam_conv structure. See pam_conv(3).
79
80 PAM_FAIL_DELAY
81 A function pointer to redirect centrally managed failure delays. See
82 pam_fail_delay(3).
83
84 If a service module wishes to obtain the name of the user, it should
85 not use this function, but instead perform a call to pam_get_user(3).
86
87 Only a service module is privileged to read the authentication tokens,
88 PAM_AUTHTOK and PAM_OLDAUTHTOK.
89
91 PAM_BAD_ITEM
92 The application attempted to set an undefined or inaccessible item.
93
94 PAM_BUF_ERR
95 Memory buffer error.
96
97 PAM_PERM_DENIED
98 The value of item was NULL.
99
100 PAM_SUCCESS
101 Data was successful updated.
102
103 PAM_SYSTEM_ERR
104 The pam_handle_t passed as first argument was invalid.
105
107 pam_set_item(3), pam_strerror(3)
108
109
110
111Linux-PAM Manual 06/27/2006 PAM_GET_ITEM(3)