1PAM_GET_USER(3) Linux-PAM Manual PAM_GET_USER(3)
2
3
4
6 pam_get_user - get user name
7
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
15 The pam_get_user function returns the name of the user specified by
16 pam_start(3). If no user was specified it returns what pam_get_item
17 (pamh, PAM_USER, ... ); would have returned. If this is NULL it obtains
18 the username via the pam_conv(3) mechanism, it prompts the user with
19 the 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 By whatever means the username is obtained, a pointer to it is returned
28 as the contents of *user. Note, this memory should not be free()'d or
29 modified by the module.
30
31 This function sets the PAM_USER item associated with the
32 pam_set_item(3) and pam_get_item(3) functions.
33
35 PAM_SUCCESS
36 User name was successful retrieved.
37
38 PAM_SYSTEM_ERR
39 A NULL pointer was submitted.
40
41 PAM_CONV_ERR
42 The conversation method supplied by the application failed to
43 obtain the username.
44
45 PAM_BUF_ERR
46 Memory buffer error.
47
48 PAM_ABORT
49 Error resuming an old conversation.
50
51 PAM_CONV_AGAIN
52 The conversation method supplied by the application is waiting for
53 an event.
54
56 pam_end(3), pam_get_item(3), pam_set_item(3), pam_strerror(3)
57
58
59
60Linux-PAM Manual 06/08/2020 PAM_GET_USER(3)