1 .\" $NetBSD: pam_conv.3,v 1.4 2005/02/20 19:33:59 wiz Exp $
4 .\" Copyright (c) 2002-2003 Networks Associates Technology, Inc.
5 .\" Copyright (c) 2004-2007 Dag-Erling Smørgrav
6 .\" All rights reserved.
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.
13 .\" Redistribution and use in source and binary forms, with or without
14 .\" modification, are permitted provided that the following conditions
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
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
37 .\" $Id: pam_conv.3,v 1.5 2008/01/27 01:22:56 christos Exp $
44 .Nd PAM conversation system
48 .In security/pam_appl.h
61 int (*conv)(int, const struct pam_message **,
62 struct pam_response **, void *);
67 The PAM library uses an application-defined callback to communicate
69 This callback is specified by the
73 at the start of the transaction.
74 It is also possible to set or change the conversation function at any
75 point during a PAM transaction by changing the value of the
79 The conversation function's first argument specifies the number of
83 The second argument is a pointer to an array of pointers to
85 structures containing the actual messages.
87 Each message can have one of four types, specified by the
90 .Vt struct pam_message :
92 .It Dv PAM_PROMPT_ECHO_OFF
93 Display a prompt and accept the user's response without echoing it to
95 This is commonly used for passwords.
96 .It Dv PAM_PROMPT_ECHO_ON
97 Display a prompt and accept the user's response, echoing it to the
99 This is commonly used for login names and one-time passphrases.
101 Display an error message.
103 Display an informational message.
106 In each case, the prompt or message to display is pointed to by the
109 .Vt struct pam_message .
112 characters long, including the terminating NUL.
114 On success, the conversation function should allocate and fill a
116 .Vt struct pam_response ,
117 one for each message that was passed in.
118 A pointer to the user's response to each message (or
120 in the case of informational or error messages) should be stored in
123 member of the corresponding
124 .Vt struct pam_response .
125 Each response can be up to
126 .Dv PAM_MAX_RESP_SIZE
127 characters long, including the terminating NUL.
132 .Vt struct pam_response
133 is unused and should be set to zero.
135 The conversation function should store a pointer to this array in the
136 location pointed to by its third argument.
137 It is the caller's responsibility to release both this array and the
138 responses themselves, using
140 It is the conversation function's responsibility to ensure that it is
147 is passed unmodified to the conversation function as its fourth and
150 On failure, the conversation function should release any resources it
151 has allocated, and return one of the predefined PAM error codes.
153 The conversation function should return one of the following values:
155 .It Bq Er PAM_BUF_ERR
157 .It Bq Er PAM_CONV_ERR
158 Conversation failure.
159 .It Bq Er PAM_SUCCESS
161 .It Bq Er PAM_SYSTEM_ERR
165 .Xr openpam_nullconv 3 ,
166 .Xr openpam_ttyconv 3 ,
176 .%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
180 The OpenPAM library and this manual page were developed for the
182 Project by ThinkSec AS and Network Associates Laboratories,
183 the Security Research Division of Network Associates, Inc. under
184 DARPA/SPAWAR contract N66001-01-C-8035
186 as part of the DARPA CHATS research program.