xref: /netbsd-src/external/bsd/openpam/dist/doc/man/pam_get_item.3 (revision 1897181a7231d5fc7ab48994d1447fcbc4e13a49)
1.\"	$NetBSD: pam_get_item.3,v 1.2 2011/12/25 22:27:55 christos Exp $
2.\"
3.\"-
4.\" Copyright (c) 2001-2003 Networks Associates Technology, Inc.
5.\" Copyright (c) 2004-2011 Dag-Erling Smørgrav
6.\" All rights reserved.
7.\"
8.\" This software was developed for the FreeBSD Project by ThinkSec AS and
9.\" Network Associates Laboratories, the Security Research Division of
10.\" Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
11.\" ("CBOSS"), as part of the DARPA CHATS research program.
12.\"
13.\" Redistribution and use in source and binary forms, with or without
14.\" modification, are permitted provided that the following conditions
15.\" are met:
16.\" 1. Redistributions of source code must retain the above copyright
17.\"    notice, this list of conditions and the following disclaimer.
18.\" 2. Redistributions in binary form must reproduce the above copyright
19.\"    notice, this list of conditions and the following disclaimer in the
20.\"    documentation and/or other materials provided with the distribution.
21.\" 3. The name of the author may not be used to endorse or promote
22.\"    products derived from this software without specific prior written
23.\"    permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35.\" SUCH DAMAGE.
36.\"
37.\" Id
38.\"
39.Dd December 18, 2011
40.Dt PAM_GET_ITEM 3
41.Os
42.Sh NAME
43.Nm pam_get_item
44.Nd get PAM information
45.Sh LIBRARY
46.Lb libpam
47.Sh SYNOPSIS
48.In sys/types.h
49.In security/pam_appl.h
50.Ft "int"
51.Fn pam_get_item "const pam_handle_t *pamh" "int item_type" "const void **item"
52.Sh DESCRIPTION
53The
54.Nm
55function stores a pointer to the item specified by
56the
57.Fa item_type
58argument in the location pointed to by the
59.Fa item
60argument.
61The item is retrieved from the PAM context specified by the
62.Fa pamh
63argument.
64If
65.Nm
66fails, the
67.Fa item
68argument is untouched.
69.Pp
70The following item types are recognized:
71.Bl -tag -width 18n
72.It Dv PAM_SERVICE
73The name of the requesting service.
74.It Dv PAM_USER
75The name of the user the application is trying to
76authenticate.
77.It Dv PAM_TTY
78The name of the current terminal.
79.It Dv PAM_RHOST
80The name of the applicant's host.
81.It Dv PAM_CONV
82A
83.Vt struct pam_conv
84describing the current conversation
85function.
86.It Dv PAM_AUTHTOK
87The current authentication token.
88.It Dv PAM_OLDAUTHTOK
89The expired authentication token.
90.It Dv PAM_RUSER
91The name of the applicant.
92.It Dv PAM_USER_PROMPT
93The prompt to use when asking the applicant for a user
94name to authenticate as.
95.It Dv PAM_AUTHTOK_PROMPT
96The prompt to use when asking the applicant for an
97authentication token.
98.It Dv PAM_OLDAUTHTOK_PROMPT
99The prompt to use when asking the applicant for an
100expired authentication token prior to changing it.
101.It Dv PAM_HOST
102The name of the host the application runs on.
103.It Dv PAM_SOCKADDR
104The sockaddr_storage of the applicants's host.
105.It Dv PAM_NUSER
106The
107.Do
108nested
109.Dc
110user if this is a login on top of a previous one.
111.El
112.Pp
113See
114.Xr pam_start 3
115for a description of
116.Vt struct pam_conv .
117.Sh RETURN VALUES
118The
119.Nm
120function returns one of the following values:
121.Bl -tag -width 18n
122.It Bq Er PAM_SYMBOL_ERR
123Invalid symbol.
124.It Bq Er PAM_SYSTEM_ERR
125System error.
126.El
127.Sh SEE ALSO
128.Xr pam 3 ,
129.Xr pam_set_item 3 ,
130.Xr pam_start 3 ,
131.Xr pam_strerror 3
132.Sh STANDARDS
133.Rs
134.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
135.%D "June 1997"
136.Re
137.Sh AUTHORS
138The
139.Nm
140function and this manual page were developed for the
141.Fx
142Project by
143ThinkSec AS and Network Associates Laboratories, the
144Security Research Division of Network Associates, Inc.\& under
145DARPA/SPAWAR contract N66001-01-C-8035
146.Pq Dq CBOSS ,
147as part of the DARPA CHATS research program.
148