1PAM_SET_ITEM(3) Linux-PAM Manual PAM_SET_ITEM(3)
2
3
4
6 pam_set_item - set and update PAM informations
7
9 #include <security/pam_modules.h>
10
11 int pam_set_item(pam_handle_t *pamh, int item_type, const void *item);
12
14 The pam_set_item function allows applications and PAM service modules
15 to access and to update PAM informations of item_type. For this a copy
16 of the object pointed to by the item argument is created. The following
17 item_types are supported:
18
19 PAM_SERVICE
20 The service name (which identifies that PAM stack that the PAM
21 functions will use to authenticate the program).
22
23 PAM_USER
24 The username of the entity under whose identity service will be
25 given. That is, following authentication, PAM_USER identifies the
26 local entity that gets to use the service. Note, this value can be
27 mapped from something (eg., "anonymous") to something else (eg.
28 "guest119") by any module in the PAM stack. As such an application
29 should consult the value of PAM_USER after each call to a PAM
30 function.
31
32 PAM_USER_PROMPT
33 The string used when prompting for a userĀ“s name. The default value
34 for this string is a localized version of "login: ".
35
36 PAM_TTY
37 The terminal name: prefixed by /dev/ if it is a device file; for
38 graphical, X-based, applications the value for this item should be
39 the $DISPLAY variable.
40
41 PAM_RUSER
42 The requesting user name: local name for a locally requesting user
43 or a remote user name for a remote requesting user.
44
45 Generally an application or module will attempt to supply the value
46 that is most strongly authenticated (a local account before a
47 remote one. The level of trust in this value is embodied in the
48 actual authentication stack associated with the application, so it
49 is ultimately at the discretion of the system administrator.
50
51
52 PAM_RUSER@PAM_RHOST should always identify the requesting user. In
53 some cases, PAM_RUSER may be NULL. In such situations, it is
54 unclear who the requesting entity is.
55
56 PAM_RHOST
57 The requesting hostname (the hostname of the machine from which the
58 PAM_RUSER entity is requesting service). That is
59 PAM_RUSER@PAM_RHOST does identify the requesting user. In some
60 applications, PAM_RHOST may be NULL. In such situations, it is
61 unclear where the authentication request is originating from.
62
63 PAM_AUTHTOK
64 The authentication token (often a password). This token should be
65 ignored by all module functions besides pam_sm_authenticate(3) and
66 pam_sm_chauthtok(3). In the former function it is used to pass the
67 most recent authentication token from one stacked module to
68 another. In the latter function the token is used for another
69 purpose. It contains the currently active authentication token.
70
71 PAM_OLDAUTHTOK
72 The old authentication token. This token should be ignored by all
73 module functions except pam_sm_chauthtok(3).
74
75 PAM_CONV
76 The pam_conv structure. See pam_conv(3).
77
78 The following additional items are specific to Linux-PAM and should not
79 be used in portable applications:
80
81 PAM_FAIL_DELAY
82 A function pointer to redirect centrally managed failure delays.
83 See pam_fail_delay(3).
84
85 PAM_XDISPLAY
86 The name of the X display. For graphical, X-based applications the
87 value for this item should be the $DISPLAY variable. This value may
88 be used independently of PAM_TTY for passing the name of the
89 display.
90
91 PAM_XAUTHDATA
92 A pointer to a structure containing the X authentication data
93 required to make a connection to the display specified by
94 PAM_XDISPLAY, if such information is necessary. See
95 pam_xauth_data(3).
96
97 PAM_AUTHTOK_TYPE
98 The default action is for the module to use the following prompts
99 when requesting passwords: "New UNIX password: " and "Retype UNIX
100 password: ". The example word UNIX can be replaced with this item,
101 by default it is empty. This item is used by pam_get_authtok(3).
102
103 For all item_types, other than PAM_CONV and PAM_FAIL_DELAY, item is a
104 pointer to a <NUL> terminated character string. In the case of
105 PAM_CONV, item points to an initialized pam_conv structure. In the case
106 of PAM_FAIL_DELAY, item is a function pointer: void (*delay_fn)(int
107 retval, unsigned usec_delay, void *appdata_ptr)
108
109 Both, PAM_AUTHTOK and PAM_OLDAUTHTOK, will be reseted before returning
110 to the application. Which means an application is not able to access
111 the authentication tokens.
112
114 PAM_BAD_ITEM
115 The application attempted to set an undefined or inaccessible item.
116
117 PAM_BUF_ERR
118 Memory buffer error.
119
120 PAM_SUCCESS
121 Data was successful updated.
122
123 PAM_SYSTEM_ERR
124 The pam_handle_t passed as first argument was invalid.
125
127 pam_get_item(3), pam_strerror(3)
128
129
130
131Linux-PAM Manual 03/02/2009 PAM_SET_ITEM(3)