# pam_get_user(3) - phpMan

[PAM_GET_USER(3)]                Linux-PAM Manual                [PAM_GET_USER(3)]



**NAME**
       pam_get_user - get user name

**SYNOPSIS**
       **#include** **<security/pam**___**modules.h>**

       **int** **pam**___**get**___**user(const** **pam**___**handle**___**t** *****_pamh_**,** **const** **char** ******_user_**,**
                        **const** **char** *****_prompt_**);**

**DESCRIPTION**
       The **pam**___**get**___**user** function returns the name of the user specified by
       **pam**___**[start**(3)]. If no user was specified it returns what **pam**___**get**___**item**
       **(pamh,** **PAM**___**USER,** **...** **);** would have returned. If this is NULL it obtains
       the username via the **pam**___**[conv**(3)] mechanism, it prompts the user with
       the first non-NULL string in the following list:

       **o**   The _prompt_ argument passed to the function.

       **o**   What is returned by pam_get_item (pamh, PAM_USER_PROMPT, ... );

       **o**   The default prompt: "login: "

       By whatever means the username is obtained, a pointer to it is returned
       as the contents of _*user_. Note, this memory should **not** be _free()_'d or
       _modified_ by the module.

       This function sets the _PAM_USER_ item associated with the
       **pam**___**set**___**[item**(3)] and **pam**___**get**___**[item**(3)] functions.

**RETURN** **VALUES**
       PAM_SUCCESS
           User name was successful retrieved.

       PAM_SYSTEM_ERR
           A NULL pointer was submitted.

       PAM_CONV_ERR
           The conversation method supplied by the application failed to
           obtain the username.

       PAM_BUF_ERR
           Memory buffer error.

       PAM_ABORT
           Error resuming an old conversation.

       PAM_CONV_AGAIN
           The conversation method supplied by the application is waiting for
           an event.

**SEE** **ALSO**
       **pam**___**[end**(3)], **pam**___**get**___**[item**(3)], **pam**___**set**___**[item**(3)], **pam**___**[strerror**(3)]



Linux-PAM Manual                  06/08/2020                   [PAM_GET_USER(3)]
