| 1 |
'\" t |
| 2 |
.\" Title: pam_get_user |
| 3 |
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/> |
| 5 |
.\" Date: 06/29/2025 |
| 6 |
.\" Manual: Linux-PAM Manual |
| 7 |
.\" Source: Linux-PAM |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "PAM_GET_USER" "3" "06/29/2025" "Linux\-PAM" "Linux\-PAM Manual" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
pam_get_user \- get user name |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.ft B |
| 35 |
.nf |
| 36 |
#include <security/pam_modules\&.h> |
| 37 |
.fi |
| 38 |
.ft |
| 39 |
.HP \w'int\ pam_get_user('u |
| 40 |
.BI "int pam_get_user(const\ pam_handle_t\ *" "pamh" ", const\ char\ **" "user" ", const\ char\ *" "prompt" ");" |
| 41 |
.SH "DESCRIPTION" |
| 42 |
.PP |
| 43 |
The |
| 44 |
\fBpam_get_user\fR |
| 45 |
function returns the name of the user specified by |
| 46 |
\fBpam_start\fR(3)\&. If no user was specified it returns what |
| 47 |
\fBpam_get_item (pamh, PAM_USER, \&.\&.\&. );\fR |
| 48 |
would have returned\&. If this is NULL it obtains the username via the |
| 49 |
\fBpam_conv\fR(3) |
| 50 |
mechanism, it prompts the user with the first non\-NULL string in the following list: |
| 51 |
.sp |
| 52 |
.RS 4 |
| 53 |
.ie n \{\ |
| 54 |
\h'-04'\(bu\h'+03'\c |
| 55 |
.\} |
| 56 |
.el \{\ |
| 57 |
.sp -1 |
| 58 |
.IP \(bu 2.3 |
| 59 |
.\} |
| 60 |
The |
| 61 |
\fIprompt\fR |
| 62 |
argument passed to the function\&. |
| 63 |
.RE |
| 64 |
.sp |
| 65 |
.RS 4 |
| 66 |
.ie n \{\ |
| 67 |
\h'-04'\(bu\h'+03'\c |
| 68 |
.\} |
| 69 |
.el \{\ |
| 70 |
.sp -1 |
| 71 |
.IP \(bu 2.3 |
| 72 |
.\} |
| 73 |
What is returned by pam_get_item (pamh, PAM_USER_PROMPT, \&.\&.\&. ); |
| 74 |
.RE |
| 75 |
.sp |
| 76 |
.RS 4 |
| 77 |
.ie n \{\ |
| 78 |
\h'-04'\(bu\h'+03'\c |
| 79 |
.\} |
| 80 |
.el \{\ |
| 81 |
.sp -1 |
| 82 |
.IP \(bu 2.3 |
| 83 |
.\} |
| 84 |
The default prompt: "login: " |
| 85 |
.RE |
| 86 |
.PP |
| 87 |
By whatever means the username is obtained, a pointer to it is returned as the contents of |
| 88 |
\fI*user\fR\&. Note, this memory should |
| 89 |
\fBnot\fR |
| 90 |
be |
| 91 |
\fIfree()\fR\*(Aqd or |
| 92 |
\fImodified\fR |
| 93 |
by the module\&. |
| 94 |
.PP |
| 95 |
This function sets the |
| 96 |
\fIPAM_USER\fR |
| 97 |
item associated with the |
| 98 |
\fBpam_set_item\fR(3) |
| 99 |
and |
| 100 |
\fBpam_get_item\fR(3) |
| 101 |
functions\&. |
| 102 |
.SH "RETURN VALUES" |
| 103 |
.PP |
| 104 |
PAM_SUCCESS |
| 105 |
.RS 4 |
| 106 |
User name was successful retrieved\&. |
| 107 |
.RE |
| 108 |
.PP |
| 109 |
PAM_SYSTEM_ERR |
| 110 |
.RS 4 |
| 111 |
A NULL pointer was submitted\&. |
| 112 |
.RE |
| 113 |
.PP |
| 114 |
PAM_CONV_ERR |
| 115 |
.RS 4 |
| 116 |
The conversation method supplied by the application failed to obtain the username\&. |
| 117 |
.RE |
| 118 |
.PP |
| 119 |
PAM_BUF_ERR |
| 120 |
.RS 4 |
| 121 |
Memory buffer error\&. |
| 122 |
.RE |
| 123 |
.PP |
| 124 |
PAM_ABORT |
| 125 |
.RS 4 |
| 126 |
Error resuming an old conversation\&. |
| 127 |
.RE |
| 128 |
.PP |
| 129 |
PAM_CONV_AGAIN |
| 130 |
.RS 4 |
| 131 |
The conversation method supplied by the application is waiting for an event\&. |
| 132 |
.RE |
| 133 |
.SH "SEE ALSO" |
| 134 |
.PP |
| 135 |
\fBpam_end\fR(3), |
| 136 |
\fBpam_get_item\fR(3), |
| 137 |
\fBpam_set_item\fR(3), |
| 138 |
\fBpam_strerror\fR(3) |