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

NAME

6       pam_set_item - set and update PAM informations
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 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 remote
47          one. The level of trust in this value is embodied in the actual
48          authentication stack associated with the application, so it is
49          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 unclear
54          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 PAM_RUSER@PAM_RHOST
59          does identify the requesting user. In some applications, PAM_RHOST
60          may be NULL. In such situations, it is unclear where the
61          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 another.
68          In the latter function the token is used for another purpose. It
69          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       PAM_FAIL_DELAY
79          A function pointer to redirect centrally managed failure delays. See
80          pam_fail_delay(3).
81
82       For all item_types, other than PAM_CONV and PAM_FAIL_DELAY, item is a
83       pointer to a <NUL> terminated character string. In the case of
84       PAM_CONV, item points to an initialized pam_conv structure. In the case
85       of PAM_FAIL_DELAY, item is a function pointer: void (*delay_fn)(int
86       retval, unsigned usec_delay, void *appdata_ptr)
87
88       Both, PAM_AUTHTOK and PAM_OLDAUTHTOK, will be reseted before returning
89       to the application. Which means an application is not able to access
90       the authentication tokens.
91

RETURN VALUES

93       PAM_BAD_ITEM
94          The application attempted to set an undefined or inaccessible item.
95
96       PAM_BUF_ERR
97          Memory buffer error.
98
99       PAM_SUCCESS
100          Data was successful updated.
101
102       PAM_SYSTEM_ERR
103          The pam_handle_t passed as first argument was invalid.
104

SEE ALSO

106       pam_get_item(3), pam_strerror(3)
107
108
109
110Linux-PAM Manual                  06/27/2006                   PAM_SET_ITEM(3)
Impressum