xref: /netbsd-src/external/bsd/openpam/dist/doc/man/pam_get_user.3 (revision 0d9d0fd8a30be9a1924e715bbcf67a4a83efd262)
1*0d9d0fd8Schristos.\"	$NetBSD: pam_get_user.3,v 1.10 2023/06/30 21:46:20 christos Exp $
244269bb5Schristos.\"
38fa0fefeSchristos.\" Generated from pam_get_user.c by gendoc.pl
4*0d9d0fd8Schristos.Dd June 27, 2023
544269bb5Schristos.Dt PAM_GET_USER 3
644269bb5Schristos.Os
744269bb5Schristos.Sh NAME
844269bb5Schristos.Nm pam_get_user
944269bb5Schristos.Nd retrieve user name
1044269bb5Schristos.Sh SYNOPSIS
1144269bb5Schristos.In sys/types.h
1244269bb5Schristos.In security/pam_appl.h
1344269bb5Schristos.Ft "int"
1444269bb5Schristos.Fn pam_get_user "pam_handle_t *pamh" "const char **user" "const char *prompt"
1544269bb5Schristos.Sh DESCRIPTION
1644269bb5SchristosThe
17e1b25b17Schristos.Fn pam_get_user
1844269bb5Schristosfunction returns the name of the target user, as
1944269bb5Schristosspecified to
2044269bb5Schristos.Xr pam_start 3 .
2144269bb5SchristosIf no user was specified, nor set using
2244269bb5Schristos.Xr pam_set_item 3 ,
23e1b25b17Schristos.Fn pam_get_user
2444269bb5Schristoswill prompt for a user name.
2544269bb5SchristosEither way, a pointer to the user name is stored in the location
2644269bb5Schristospointed to by the
2744269bb5Schristos.Fa user
288fa0fefeSchristosargument, and the corresponding PAM item is
298fa0fefeSchristosupdated.
3044269bb5Schristos.Pp
3144269bb5SchristosThe
3244269bb5Schristos.Fa prompt
3344269bb5Schristosargument specifies a prompt to use if no user name is
3444269bb5Schristoscached.
3544269bb5SchristosIf it is
3644269bb5Schristos.Dv NULL ,
3744269bb5Schristosthe
3844269bb5Schristos.Dv PAM_USER_PROMPT
3944269bb5Schristositem will be used.
4044269bb5SchristosIf that item is also
4144269bb5Schristos.Dv NULL ,
4244269bb5Schristosa hardcoded default prompt will be used.
438fa0fefeSchristosAdditionally, when
44e1b25b17Schristos.Fn pam_get_user
458fa0fefeSchristosis called from a service module, the
468fa0fefeSchristosprompt may be affected by module options as described below.
478fa0fefeSchristosThe prompt is then expanded using
488fa0fefeSchristos.Xr openpam_subst 3
498fa0fefeSchristosbefore it is passed to
508fa0fefeSchristosthe conversation function.
518fa0fefeSchristos.Sh MODULE OPTIONS
528fa0fefeSchristosWhen called by a service module,
538fa0fefeSchristos.Fn pam_get_user
548fa0fefeSchristoswill recognize the
558fa0fefeSchristosfollowing module options:
568fa0fefeSchristos.Bl -tag -width 18n
578fa0fefeSchristos.It Dv user_prompt
588fa0fefeSchristosPrompt to use when asking for the user name.
598fa0fefeSchristosThis option overrides both the
6044269bb5Schristos.Fa prompt
6144269bb5Schristosargument and the
6244269bb5Schristos.Dv PAM_USER_PROMPT
6344269bb5Schristositem.
648fa0fefeSchristos.El
6544269bb5Schristos.Sh RETURN VALUES
6644269bb5SchristosThe
67e1b25b17Schristos.Fn pam_get_user
6844269bb5Schristosfunction returns one of the following values:
6944269bb5Schristos.Bl -tag -width 18n
704cb4af11Schristos.It Bq Er PAM_SUCCESS
714cb4af11SchristosSuccess.
724cb4af11Schristos.It Bq Er PAM_BAD_ITEM
734cb4af11SchristosUnrecognized or restricted item.
7444269bb5Schristos.It Bq Er PAM_BUF_ERR
7544269bb5SchristosMemory buffer error.
7644269bb5Schristos.It Bq Er PAM_CONV_ERR
7744269bb5SchristosConversation failure.
7844269bb5Schristos.It Bq Er PAM_SYSTEM_ERR
7944269bb5SchristosSystem error.
8044269bb5Schristos.El
8144269bb5Schristos.Sh SEE ALSO
828fa0fefeSchristos.Xr openpam_get_option 3 ,
8344269bb5Schristos.Xr openpam_subst 3 ,
8444269bb5Schristos.Xr pam 3 ,
858fa0fefeSchristos.Xr pam_conv 3 ,
8644269bb5Schristos.Xr pam_get_authtok 3 ,
8744269bb5Schristos.Xr pam_get_item 3 ,
8844269bb5Schristos.Xr pam_set_item 3 ,
8944269bb5Schristos.Xr pam_start 3 ,
9044269bb5Schristos.Xr pam_strerror 3
9144269bb5Schristos.Sh STANDARDS
9244269bb5Schristos.Rs
9344269bb5Schristos.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
9444269bb5Schristos.%D "June 1997"
9544269bb5Schristos.Re
9644269bb5Schristos.Sh AUTHORS
9744269bb5SchristosThe
98e1b25b17Schristos.Fn pam_get_user
99e1b25b17Schristosfunction and this manual page were
100e1b25b17Schristosdeveloped for the
10144269bb5Schristos.Fx
102e1b25b17SchristosProject by ThinkSec AS and Network Associates Laboratories, the
10344269bb5SchristosSecurity Research Division of Network Associates, Inc.\& under
10444269bb5SchristosDARPA/SPAWAR contract N66001-01-C-8035
10544269bb5Schristos.Pq Dq CBOSS ,
10644269bb5Schristosas part of the DARPA CHATS research program.
1078fa0fefeSchristos.Pp
1088fa0fefeSchristosThe OpenPAM library is maintained by
1094cb4af11Schristos.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .
110