]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/libgssapi/gss_display_status.3
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / lib / libgssapi / gss_display_status.3
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (c) 2005 Doug Rabson
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\"     $FreeBSD$
28 .\"
29 .\" The following commands are required for all man pages.
30 .Dd January 26, 2010
31 .Dt GSS_DISPLAY_STATUS 3 PRM
32 .Os
33 .Sh NAME
34 .Nm gss_display_status
35 .Nd Convert a GSS-API status code to text
36 .\" This next command is for sections 2 and 3 only.
37 .\" .Sh LIBRARY
38 .Sh SYNOPSIS
39 .In "gssapi/gssapi.h"
40 .Ft OM_uint32
41 .Fo gss_display_status
42 .Fa "OM_uint32 *minor_status"
43 .Fa "OM_uint32 status_value"
44 .Fa "int status_type"
45 .Fa "const gss_OID mech_type"
46 .Fa "OM_uint32 *message_context"
47 .Fa "gss_buffer_t status_string"
48 .Fc
49 .Sh DESCRIPTION
50 Allows an application to obtain a textual representation of a GSS-API
51 status code,
52 for display to the user or for logging purposes.
53 Since some status values may indicate multiple conditions,
54 applications may need to call
55 .Fn gss_display_status
56 multiple times,
57 each call generating a single text string.
58 The
59 .Fa message_context
60 parameter is used by
61 .Fn gss_display_status
62 to store state information about which error messages have already
63 been extracted from a given
64 .Fa status_value ;
65 .Fa message_context
66 must be initialized to zero by the application prior to the first call,
67 and
68 .Fn gss_display_status
69 will return a non-zero value in this parameter if there are further
70 messages to extract.
71 .Pp
72 The
73 .Fa message_context
74 parameter contains all state information required by
75 .Fn gss_display_status
76 in order to extract further messages from the
77 .Fa status_value ;
78 even when a non-zero value is returned in this parameter,
79 the application is not required to call
80 .Fn gss_display_status
81 again unless subsequent messages are desired.
82 The following code extracts all messages from a given status code and prints them to stderr:
83 .Bd -literal
84 OM_uint32 message_context;
85 OM_uint32 status_code;
86 OM_uint32 maj_status;
87 OM_uint32 min_status;
88 gss_buffer_desc status_string;
89
90        ...
91
92 message_context = 0;
93
94 do {
95
96   maj_status = gss_display_status (
97                   &min_status,
98                   status_code,
99                   GSS_C_GSS_CODE,
100                   GSS_C_NO_OID,
101                   &message_context,
102                   &status_string)
103
104   fprintf(stderr,
105           "%.*s\\n",
106          (int)status_string.length,
107          (char *)status_string.value);
108
109   gss_release_buffer(&min_status, &status_string);
110
111 } while (message_context != 0);
112 .Ed
113 .Sh PARAMETERS
114 .Bl -tag
115 .It minor_status
116 Mechanism specific status code.
117 .It status_value
118 Status value to be converted
119 .It status_type
120 .Bl -tag                     
121 .It GSS_C_GSS_CODE
122 .Fa status_value
123 is a GSS status code
124 .It GSS_C_MECH_CODE
125 .Fa status_value
126 is a mechanism status code
127 .El
128 .It mech_type
129 Underlying mechanism (used to interpret a minor status value).
130 Supply
131 .Dv GSS_C_NO_OID
132 to obtain the system default.
133 .It message_context
134 Should be initialized to zero by the application prior to the first
135 call.
136 On return from
137 .Fn gss_display_status ,
138 a non-zero status_value parameter indicates that additional messages
139 may be extracted from the status code via subsequent calls to
140 .Fn gss_display_status ,
141 passing the same
142 .Fa status_value ,
143 .Fa status_type ,
144 .Fa mech_type ,
145 and
146 .Fa message_context
147 parameters.
148 .It status_string
149 Textual interpretation of the
150 .Fa status_value .
151 Storage associated with this parameter must be freed by the
152 application after use with a call to
153 .Fn gss_release_buffer .
154 .El
155 .Sh RETURN VALUES
156 .Bl -tag
157 .It GSS_S_COMPLETE
158 Successful completion
159 .It GSS_S_BAD_MECH
160 Indicates that translation in accordance with an unsupported mechanism
161 type was requested
162 .It GSS_S_BAD_STATUS
163 The status value was not recognized, or the status type was neither
164 .Dv GSS_C_GSS_CODE
165 nor
166 .Dv GSS_C_MECH_CODE .
167 .El
168 .Sh SEE ALSO
169 .Xr gss_release_buffer 3
170 .Sh STANDARDS
171 .Bl -tag
172 .It RFC 2743
173 Generic Security Service Application Program Interface Version 2, Update 1
174 .It RFC 2744
175 Generic Security Service API Version 2 : C-bindings
176 .El
177 .Sh HISTORY
178 The
179 .Nm
180 function first appeared in
181 .Fx 7.0 .
182 .Sh AUTHORS
183 John Wray, Iris Associates
184 .Sh COPYRIGHT
185 Copyright (C) The Internet Society (2000).  All Rights Reserved.
186 .Pp
187 This document and translations of it may be copied and furnished to
188 others, and derivative works that comment on or otherwise explain it
189 or assist in its implementation may be prepared, copied, published
190 and distributed, in whole or in part, without restriction of any
191 kind, provided that the above copyright notice and this paragraph are
192 included on all such copies and derivative works.  However, this
193 document itself may not be modified in any way, such as by removing
194 the copyright notice or references to the Internet Society or other
195 Internet organizations, except as needed for the purpose of
196 developing Internet standards in which case the procedures for
197 copyrights defined in the Internet Standards process must be
198 followed, or as required to translate it into languages other than
199 English.
200 .Pp
201 The limited permissions granted above are perpetual and will not be
202 revoked by the Internet Society or its successors or assigns.
203 .Pp
204 This document and the information contained herein is provided on an
205 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
206 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
207 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
208 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
209 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.