]> granicus.if.org Git - linux-pam/blob - doc/man/pam_set_item.3
Relevant BUGIDs: 1427738
[linux-pam] / doc / man / pam_set_item.3
1 .\"     Title: pam_set_item
2 .\"    Author: 
3 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
4 .\"      Date: 06/02/2006
5 .\"    Manual: Linux\-PAM Manual
6 .\"    Source: Linux\-PAM Manual
7 .\"
8 .TH "PAM_SET_ITEM" "3" "06/02/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_set_item \- set and update 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_set_item(pam_handle_t\ *" "pamh" ", int\ " "item_type" ", const\ void\ *" "item" ");"
24 .SH "DESCRIPTION"
25 .PP
26 The
27 \fBpam_set_item\fR
28 function allows applications and PAM service modules to access and to update PAM informations of
29 \fIitem_type\fR. For this a copy of the object pointed to by the
30 \fIitem\fR
31 argument is created. The following
32 \fIitem_type\fRs are supported:
33 .TP 3n
34 PAM_SERVICE
35 The service name (which identifies that PAM stack that the PAM functions will use to authenticate the program).
36 .TP 3n
37 PAM_USER
38 The username of the entity under whose identity service will be given. That is, following authentication,
39 \fIPAM_USER\fR
40 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
41 \fIPAM_USER\fR
42 after each call to a PAM function.
43 .TP 3n
44 PAM_USER_PROMPT
45 The string used when prompting for a user's name. The default value for this string is a localized version of "login: ".
46 .TP 3n
47 PAM_TTY
48 The terminal name: prefixed by
49 \fI/dev/\fR
50 if it is a device file; for graphical, X\-based, applications the value for this item should be the
51 \fI$DISPLAY\fR
52 variable.
53 .TP 3n
54 PAM_RUSER
55 The requesting user name: local name for a locally requesting user or a remote user name for a remote requesting user.
56 .sp
57 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.
58 .sp
59
60 \fIPAM_RUSER@PAM_RHOST\fR
61 should always identify the requesting user. In some cases,
62 \fIPAM_RUSER\fR
63 may be NULL. In such situations, it is unclear who the requesting entity is.
64 .TP 3n
65 PAM_RHOST
66 The requesting hostname (the hostname of the machine from which the
67 \fIPAM_RUSER\fR
68 entity is requesting service). That is
69 \fIPAM_RUSER@PAM_RHOST\fR
70 does identify the requesting user. In some applications,
71 \fIPAM_RHOST\fR
72 may be NULL. In such situations, it is unclear where the authentication request is originating from.
73 .TP 3n
74 PAM_AUTHTOK
75 The authentication token (often a password). This token should be ignored by all module functions besides
76 \fBpam_sm_authenticate\fR(3)
77 and
78 \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.
79 .TP 3n
80 PAM_OLDAUTHTOK
81 The old authentication token. This token should be ignored by all module functions except
82 \fBpam_sm_chauthtok\fR(3).
83 .TP 3n
84 PAM_CONV
85 The pam_conv structure. See
86 \fBpam_conv\fR(3).
87 .TP 3n
88 PAM_FAIL_DELAY
89 A function pointer to redirect centrally managed failure delays. See
90 \fBpam_fail_delay\fR(3).
91 .PP
92 For all
93 \fIitem_type\fRs, other than PAM_CONV and PAM_FAIL_DELAY,
94 \fIitem\fR
95 is a pointer to a <NUL> terminated character string. In the case of PAM_CONV,
96 \fIitem\fR
97 points to an initialized
98 \fIpam_conv\fR
99 structure. In the case of PAM_FAIL_DELAY,
100 \fIitem\fR
101 is a function pointer:
102 \fBvoid (*delay_fn)(int retval, unsigned usec_delay, void *appdata_ptr)\fR
103 .PP
104 Both, PAM_AUTHTOK and PAM_OLDAUTHTOK, will be reseted before returning to the application. Which means an application is not able to access the authentication tokens.
105 .SH "RETURN VALUES"
106 .TP 3n
107 PAM_BAD_ITEM
108 The application attempted to set an undefined or inaccessible item.
109 .TP 3n
110 PAM_BUF_ERR
111 Memory buffer error.
112 .TP 3n
113 PAM_SUCCESS
114 Data was successful updated.
115 .TP 3n
116 PAM_SYSTEM_ERR
117 The
118 \fIpam_handle_t\fR
119 passed as first argument was invalid.
120 .SH "SEE ALSO"
121 .PP
122
123 \fBpam_get_item\fR(3),
124 \fBpam_strerror\fR(3)