pam_get_user(3) — Linux manual page


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

NAME         top

       pam_get_user - get user name

SYNOPSIS         top

       #include <security/pam_modules.h>

       int pam_get_user(const pam_handle_t *pamh, const char **user,
                        const char *prompt);

DESCRIPTION         top

       The pam_get_user function returns the name of the user specified
       by pam_start(3). If no user was specified it 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:

       •   The prompt argument passed to the function.

       •   What is returned by pam_get_item (pamh, PAM_USER_PROMPT, ...

       •   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         top

           User name was successful retrieved.

           A NULL pointer was submitted.

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

SEE ALSO         top

       pam_end(3), pam_get_item(3), pam_set_item(3), pam_strerror(3)

COLOPHON         top

       This page is part of the linux-pam (Pluggable Authentication
       Modules for Linux) project.  Information about the project can be
       found at ⟨⟩.  If you have a bug report
       for this manual page, see ⟨//⟩.  This page was
       obtained from the tarball Linux-PAM-1.3.0.tar.bz2 fetched from
       ⟨⟩ on 2021-08-27.  If you
       discover any rendering problems in this HTML version of the page,
       or you believe there is a better or more up-to-date source for
       the page, or you have corrections or improvements to the
       information in this COLOPHON (which is not part of the original
       manual page), send a mail to

Linux-PAM Manual               04/01/2016                PAM_GET_USER(3)

Pages that refer to this page: pam(3)pam_get_item(3)