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