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