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