1PAM_SET_ITEM(3)                Linux-PAM Manual                PAM_SET_ITEM(3)
2
3
4

NAME

6       pam_set_item - set and update PAM information
7

SYNOPSIS

9       #include <security/pam_modules.h>
10
11       int pam_set_item(pam_handle_t *pamh, int item_type, const void *item);
12

DESCRIPTION

14       The pam_set_item function allows applications and PAM service modules
15       to access and to update PAM information 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           PAM_RUSER@PAM_RHOST should always identify the requesting user. In
52           some cases, PAM_RUSER may be NULL. In such situations, it is
53           unclear who the requesting entity is.
54
55       PAM_RHOST
56           The requesting hostname (the hostname of the machine from which the
57           PAM_RUSER entity is requesting service). That is
58           PAM_RUSER@PAM_RHOST does identify the requesting user. In some
59           applications, PAM_RHOST may be NULL. In such situations, it is
60           unclear where the authentication request is originating from.
61
62       PAM_AUTHTOK
63           The authentication token (often a password). This token should be
64           ignored by all module functions besides pam_sm_authenticate(3) and
65           pam_sm_chauthtok(3). In the former function it is used to pass the
66           most recent authentication token from one stacked module to
67           another. In the latter function the token is used for another
68           purpose. It contains the currently active authentication token.
69
70       PAM_OLDAUTHTOK
71           The old authentication token. This token should be ignored by all
72           module functions except pam_sm_chauthtok(3).
73
74       PAM_CONV
75           The pam_conv structure. See pam_conv(3).
76
77       The following additional items are specific to Linux-PAM and should not
78       be used in portable applications:
79
80       PAM_FAIL_DELAY
81           A function pointer to redirect centrally managed failure delays.
82           See pam_fail_delay(3).
83
84       PAM_XDISPLAY
85           The name of the X display. For graphical, X-based applications the
86           value for this item should be the $DISPLAY variable. This value may
87           be used independently of PAM_TTY for passing the name of the
88           display.
89
90       PAM_XAUTHDATA
91           A pointer to a structure containing the X authentication data
92           required to make a connection to the display specified by
93           PAM_XDISPLAY, if such information is necessary. See
94           pam_xauth_data(3).
95
96       PAM_AUTHTOK_TYPE
97           The default action is for the module to use the following prompts
98           when requesting passwords: "New UNIX password: " and "Retype UNIX
99           password: ". The example word UNIX can be replaced with this item,
100           by default it is empty. This item is used by pam_get_authtok(3).
101
102       For all item_types, other than PAM_CONV and PAM_FAIL_DELAY, item is a
103       pointer to a <NUL> terminated character string. In the case of
104       PAM_CONV, item points to an initialized pam_conv structure. In the case
105       of PAM_FAIL_DELAY, item is a function pointer: void (*delay_fn)(int
106       retval, unsigned usec_delay, void *appdata_ptr)
107
108       Both, PAM_AUTHTOK and PAM_OLDAUTHTOK, will be reset before returning to
109       the application. Which means an application is not able to access the
110       authentication tokens.
111

RETURN VALUES

113       PAM_BAD_ITEM
114           The application attempted to set an undefined or inaccessible item.
115
116       PAM_BUF_ERR
117           Memory buffer error.
118
119       PAM_SUCCESS
120           Data was successful updated.
121
122       PAM_SYSTEM_ERR
123           The pam_handle_t passed as first argument was invalid.
124

SEE ALSO

126       pam_get_item(3), pam_strerror(3)
127
128
129
130Linux-PAM Manual                  11/25/2020                   PAM_SET_ITEM(3)
Impressum