2 .\" Copyright (c) 2002-2003 Networks Associates Technology, Inc.
3 .\" Copyright (c) 2004-2007 Dag-Erling Smørgrav
4 .\" All rights reserved.
6 .\" This software was developed for the FreeBSD Project by ThinkSec AS and
7 .\" Network Associates Laboratories, the Security Research Division of
8 .\" Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
9 .\" ("CBOSS"), as part of the DARPA CHATS research program.
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\" notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\" notice, this list of conditions and the following disclaimer in the
18 .\" documentation and/or other materials provided with the distribution.
19 .\" 3. The name of the author may not be used to endorse or promote
20 .\" products derived from this software without specific prior written
23 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" $Id: pam_conv.3 408 2007-12-21 11:36:24Z des $
42 .Nd PAM conversation system
46 .In security/pam_appl.h
59 int (*conv)(int, const struct pam_message **,
60 struct pam_response **, void *);
65 The PAM library uses an application-defined callback to communicate
67 This callback is specified by the
71 at the start of the transaction.
72 It is also possible to set or change the conversation function at any
73 point during a PAM transaction by changing the value of the
77 The conversation function's first argument specifies the number of
81 The second argument is a pointer to an array of pointers to
83 structures containing the actual messages.
85 Each message can have one of four types, specified by the
88 .Vt struct pam_message :
90 .It Dv PAM_PROMPT_ECHO_OFF
91 Display a prompt and accept the user's response without echoing it to
93 This is commonly used for passwords.
94 .It Dv PAM_PROMPT_ECHO_ON
95 Display a prompt and accept the user's response, echoing it to the
97 This is commonly used for login names and one-time passphrases.
99 Display an error message.
101 Display an informational message.
104 In each case, the prompt or message to display is pointed to by the
107 .Vt struct pam_message .
110 characters long, including the terminating NUL.
112 On success, the conversation function should allocate and fill a
114 .Vt struct pam_response ,
115 one for each message that was passed in.
116 A pointer to the user's response to each message (or
118 in the case of informational or error messages) should be stored in
121 member of the corresponding
122 .Vt struct pam_response .
123 Each response can be up to
124 .Dv PAM_MAX_RESP_SIZE
125 characters long, including the terminating NUL.
130 .Vt struct pam_response
131 is unused and should be set to zero.
133 The conversation function should store a pointer to this array in the
134 location pointed to by its third argument.
135 It is the caller's responsibility to release both this array and the
136 responses themselves, using
138 It is the conversation function's responsibility to ensure that it is
145 is passed unmodified to the conversation function as its fourth and
148 On failure, the conversation function should release any resources it
149 has allocated, and return one of the predefined PAM error codes.
151 The conversation function should return one of the following values:
153 .It Bq Er PAM_BUF_ERR
155 .It Bq Er PAM_CONV_ERR
156 Conversation failure.
157 .It Bq Er PAM_SUCCESS
159 .It Bq Er PAM_SYSTEM_ERR
163 .Xr openpam_nullconv 3 ,
164 .Xr openpam_ttyconv 3 ,
174 .%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
178 The OpenPAM library and this manual page were developed for the
179 FreeBSD Project by ThinkSec AS and Network Associates Laboratories,
180 the Security Research Division of Network Associates, Inc.\& under
181 DARPA/SPAWAR contract N66001-01-C-8035
183 as part of the DARPA CHATS research program.