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

NAME

6       pam_get_user - get user name
7

SYNOPSIS

9       #include <security/pam_modules.h>
10
11       int pam_get_user(const pam_handle_t *pamh, const char **user,
12                        const char *prompt);
13

DESCRIPTION

15       The pam_get_user function returns the name of the user specified by
16       pam_start(3). If no user was specified it what pam_get_item (pamh,
17       PAM_USER, ... ); would have returned. If this is NULL it obtains the
18       username via the pam_conv(3) mechanism, it prompts the user with the
19       first non-NULL string in the following list:
20
21       ·  The prompt argument passed to the function.
22
23       ·  What is returned by pam_get_item (pamh, PAM_USER_PROMPT, ... );
24
25       ·  The default prompt: "login: "
26
27
28By whatever means the username is obtained, a pointer to it is returned as the
29contents of *user. Note, this memory should not be free()'d or modified by the
30module.
31
32This function sets the PAM_USER item associated with the pam_set_item(3) and

pam_get_item(3) functions.

34

RETURN VALUES

36       PAM_SUCCESS
37          User name was successful retrieved.
38
39       PAM_SYSTEM_ERR
40          A NULL pointer was submitted.
41
42       PAM_CONV_ERR
43          The conversation method supplied by the application failed to obtain
44          the username.
45

SEE ALSO

47       pam_end(3), pam_get_item(3), pam_set_item(3), pam_strerror(3)
48
49
50
51Linux-PAM Manual                  06/27/2006                   PAM_GET_USER(3)
Impressum