summaryrefslogtreecommitdiff
path: root/Linux-PAM/doc/man/pam_get_user.3
blob: e4817865de5e7fa7ad0cac09307a9ecc909d709a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.\"     Title: pam_get_user
.\"    Author: 
.\" Generator: DocBook XSL Stylesheets v1.73.1 <http://docbook.sf.net/>
.\"      Date: 02/04/2008
.\"    Manual: Linux-PAM Manual
.\"    Source: Linux-PAM Manual
.\"
.TH "PAM_GET_USER" "3" "02/04/2008" "Linux-PAM Manual" "Linux-PAM Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
pam_get_user - get user name
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <security/pam_modules\.h>
.fi
.ft
.HP 17
.BI "int pam_get_user(const\ pam_handle_t\ *" "pamh" ", const\ char\ **" "user" ", const\ char\ *" "prompt" ");"
.SH "DESCRIPTION"
.PP
The
\fBpam_get_user\fR
function returns the name of the user specified by
\fBpam_start\fR(3)\. If no user was specified it what
\fBpam_get_item (pamh, PAM_USER, \.\.\. );\fR
would have returned\. If this is NULL it obtains the username via the
\fBpam_conv\fR(3)
mechanism, it prompts the user with the first non\-NULL string in the following list:
.sp
.RS 4
\h'-04'\(bu\h'+03'The
\fIprompt\fR
argument passed to the function\.
.RE
.sp
.RS 4
\h'-04'\(bu\h'+03'What is returned by pam_get_item (pamh, PAM_USER_PROMPT, \.\.\. );
.RE
.sp
.RS 4
\h'-04'\(bu\h'+03'The default prompt: "login: "
.RE
.PP
By whatever means the username is obtained, a pointer to it is returned as the contents of
\fI*user\fR\. Note, this memory should
\fBnot\fR
be
\fIfree()\fR\'d or
\fImodified\fR
by the module\.
.PP
This function sets the
\fIPAM_USER\fR
item associated with the
\fBpam_set_item\fR(3)
and
\fBpam_get_item\fR(3)
functions\.
.SH "RETURN VALUES"
.PP
PAM_SUCCESS
.RS 4
User name was successful retrieved\.
.RE
.PP
PAM_SYSTEM_ERR
.RS 4
A NULL pointer was submitted\.
.RE
.PP
PAM_CONV_ERR
.RS 4
The conversation method supplied by the application failed to obtain the username\.
.RE
.SH "SEE ALSO"
.PP

\fBpam_end\fR(3),
\fBpam_get_item\fR(3),
\fBpam_set_item\fR(3),
\fBpam_strerror\fR(3)