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