]> granicus.if.org Git - linux-pam/blob - doc/man/pam_get_item.3
Relevant BUGIDs:
[linux-pam] / doc / man / pam_get_item.3
1 .\"     Title: pam_get_item
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
4 .\"      Date: 06/27/2006
5 .\"    Manual: Linux\-PAM Manual
6 .\"    Source: Linux\-PAM Manual
7 .\"
8 .TH "PAM_GET_ITEM" "3" "06/27/2006" "Linux\-PAM Manual" "Linux\-PAM Manual"
9 .\" disable hyphenation
10 .nh
11 .\" disable justification (adjust text to left margin only)
12 .ad l
13 .SH "NAME"
14 pam_get_item \- getting PAM informations
15 .SH "SYNOPSIS"
16 .sp
17 .ft B
18 .nf
19 #include <security/pam_modules.h>
20 .fi
21 .ft
22 .HP 17
23 .BI "int pam_get_item(const\ pam_handle_t\ *" "pamh" ", int\ " "item_type" ", const\ void\ **" "item" ");"
24 .SH "DESCRIPTION"
25 .PP
26 The
27 \fBpam_get_item\fR
28 function allows applications and PAM service modules to access and retrieve PAM informations of
29 \fIitem_type\fR. Upon successful return,
30 \fIitem\fR
31 contains a pointer to the value of the corresponding item. Note, this is a pointer to the
32 \fIactual\fR
33 data and should
34 \fBnot\fR
35 be
36 \fIfree()\fR'ed or over\-written! The following values are supported for
37 \fIitem_type\fR:
38 .TP 3n
39 PAM_SERVICE
40 The service name (which identifies that PAM stack that the PAM functions will use to authenticate the program).
41 .TP 3n
42 PAM_USER
43 The username of the entity under whose identity service will be given. That is, following authentication,
44 \fIPAM_USER\fR
45 identifies the local entity that gets to use the service. Note, this value can be mapped from something (eg., "anonymous") to something else (eg. "guest119") by any module in the PAM stack. As such an application should consult the value of
46 \fIPAM_USER\fR
47 after each call to a PAM function.
48 .TP 3n
49 PAM_USER_PROMPT
50 The string used when prompting for a user's name. The default value for this string is a localized version of "login: ".
51 .TP 3n
52 PAM_TTY
53 The terminal name: prefixed by
54 \fI/dev/\fR
55 if it is a device file; for graphical, X\-based, applications the value for this item should be the
56 \fI$DISPLAY\fR
57 variable.
58 .TP 3n
59 PAM_RUSER
60 The requesting user name: local name for a locally requesting user or a remote user name for a remote requesting user.
61 .sp
62 Generally an application or module will attempt to supply the value that is most strongly authenticated (a local account before a remote one. The level of trust in this value is embodied in the actual authentication stack associated with the application, so it is ultimately at the discretion of the system administrator.
63 .sp
64
65 \fIPAM_RUSER@PAM_RHOST\fR
66 should always identify the requesting user. In some cases,
67 \fIPAM_RUSER\fR
68 may be NULL. In such situations, it is unclear who the requesting entity is.
69 .TP 3n
70 PAM_RHOST
71 The requesting hostname (the hostname of the machine from which the
72 \fIPAM_RUSER\fR
73 entity is requesting service). That is
74 \fIPAM_RUSER@PAM_RHOST\fR
75 does identify the requesting user. In some applications,
76 \fIPAM_RHOST\fR
77 may be NULL. In such situations, it is unclear where the authentication request is originating from.
78 .TP 3n
79 PAM_AUTHTOK
80 The authentication token (often a password). This token should be ignored by all module functions besides
81 \fBpam_sm_authenticate\fR(3)
82 and
83 \fBpam_sm_chauthtok\fR(3). In the former function it is used to pass the most recent authentication token from one stacked module to another. In the latter function the token is used for another purpose. It contains the currently active authentication token.
84 .TP 3n
85 PAM_OLDAUTHTOK
86 The old authentication token. This token should be ignored by all module functions except
87 \fBpam_sm_chauthtok\fR(3).
88 .TP 3n
89 PAM_CONV
90 The pam_conv structure. See
91 \fBpam_conv\fR(3).
92 .TP 3n
93 PAM_FAIL_DELAY
94 A function pointer to redirect centrally managed failure delays. See
95 \fBpam_fail_delay\fR(3).
96 .PP
97 If a service module wishes to obtain the name of the user, it should not use this function, but instead perform a call to
98 \fBpam_get_user\fR(3).
99 .PP
100 Only a service module is privileged to read the authentication tokens, PAM_AUTHTOK and PAM_OLDAUTHTOK.
101 .SH "RETURN VALUES"
102 .TP 3n
103 PAM_BAD_ITEM
104 The application attempted to set an undefined or inaccessible item.
105 .TP 3n
106 PAM_BUF_ERR
107 Memory buffer error.
108 .TP 3n
109 PAM_PERM_DENIED
110 The value of
111 \fIitem\fR
112 was NULL.
113 .TP 3n
114 PAM_SUCCESS
115 Data was successful updated.
116 .TP 3n
117 PAM_SYSTEM_ERR
118 The
119 \fIpam_handle_t\fR
120 passed as first argument was invalid.
121 .SH "SEE ALSO"
122 .PP
123
124 \fBpam_set_item\fR(3),
125 \fBpam_strerror\fR(3)