1.\" $NetBSD: pam_get_user.3,v 1.8 2017/05/06 19:50:09 christos Exp $ 2.\" 3.\" Generated from pam_get_user.c by gendoc.pl 4.\" $OpenPAM: pam_get_user.c 938 2017-04-30 21:34:42Z des $ 5.Dd April 30, 2017 6.Dt PAM_GET_USER 3 7.Os 8.Sh NAME 9.Nm pam_get_user 10.Nd retrieve user name 11.Sh SYNOPSIS 12.In sys/types.h 13.In security/pam_appl.h 14.Ft "int" 15.Fn pam_get_user "pam_handle_t *pamh" "const char **user" "const char *prompt" 16.Sh DESCRIPTION 17The 18.Fn pam_get_user 19function returns the name of the target user, as 20specified to 21.Xr pam_start 3 . 22If no user was specified, nor set using 23.Xr pam_set_item 3 , 24.Fn pam_get_user 25will prompt for a user name. 26Either way, a pointer to the user name is stored in the location 27pointed to by the 28.Fa user 29argument, and the corresponding PAM item is 30updated. 31.Pp 32The 33.Fa prompt 34argument specifies a prompt to use if no user name is 35cached. 36If it is 37.Dv NULL , 38the 39.Dv PAM_USER_PROMPT 40item will be used. 41If that item is also 42.Dv NULL , 43a hardcoded default prompt will be used. 44Additionally, when 45.Fn pam_get_user 46is called from a service module, the 47prompt may be affected by module options as described below. 48The prompt is then expanded using 49.Xr openpam_subst 3 50before it is passed to 51the conversation function. 52.Sh MODULE OPTIONS 53When called by a service module, 54.Fn pam_get_user 55will recognize the 56following module options: 57.Bl -tag -width 18n 58.It Dv user_prompt 59Prompt to use when asking for the user name. 60This option overrides both the 61.Fa prompt 62argument and the 63.Dv PAM_USER_PROMPT 64item. 65.El 66.Sh RETURN VALUES 67The 68.Fn pam_get_user 69function returns one of the following values: 70.Bl -tag -width 18n 71.It Bq Er PAM_SUCCESS 72Success. 73.It Bq Er PAM_BAD_ITEM 74Unrecognized or restricted item. 75.It Bq Er PAM_BUF_ERR 76Memory buffer error. 77.It Bq Er PAM_CONV_ERR 78Conversation failure. 79.It Bq Er PAM_SYSTEM_ERR 80System error. 81.El 82.Sh SEE ALSO 83.Xr openpam_get_option 3 , 84.Xr openpam_subst 3 , 85.Xr pam 3 , 86.Xr pam_conv 3 , 87.Xr pam_get_authtok 3 , 88.Xr pam_get_item 3 , 89.Xr pam_set_item 3 , 90.Xr pam_start 3 , 91.Xr pam_strerror 3 92.Sh STANDARDS 93.Rs 94.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules" 95.%D "June 1997" 96.Re 97.Sh AUTHORS 98The 99.Fn pam_get_user 100function and this manual page were 101developed for the 102.Fx 103Project by ThinkSec AS and Network Associates Laboratories, the 104Security Research Division of Network Associates, Inc.\& under 105DARPA/SPAWAR contract N66001-01-C-8035 106.Pq Dq CBOSS , 107as part of the DARPA CHATS research program. 108.Pp 109The OpenPAM library is maintained by 110.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no . 111