xref: /freebsd/lib/libgssapi/gss_display_status.3 (revision 8ddb146abcdf061be9f2c0db7e391697dafad85c)
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
50Allows an application to obtain a textual representation of a GSS-API
51status code,
52for display to the user or for logging purposes.
53Since some status values may indicate multiple conditions,
54applications may need to call
55.Fn gss_display_status
56multiple times,
57each call generating a single text string.
58The
59.Fa message_context
60parameter is used by
61.Fn gss_display_status
62to store state information about which error messages have already
63been extracted from a given
64.Fa status_value ;
65.Fa message_context
66must be initialized to zero by the application prior to the first call,
67and
68.Fn gss_display_status
69will return a non-zero value in this parameter if there are further
70messages to extract.
71.Pp
72The
73.Fa message_context
74parameter contains all state information required by
75.Fn gss_display_status
76in order to extract further messages from the
77.Fa status_value ;
78even when a non-zero value is returned in this parameter,
79the application is not required to call
80.Fn gss_display_status
81again unless subsequent messages are desired.
82The following code extracts all messages from a given status code and prints them to stderr:
83.Bd -literal
84OM_uint32 message_context;
85OM_uint32 status_code;
86OM_uint32 maj_status;
87OM_uint32 min_status;
88gss_buffer_desc status_string;
89
90       ...
91
92message_context = 0;
93
94do {
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 -width ".It minor_status"
115.It minor_status
116Mechanism specific status code.
117.It status_value
118Status value to be converted
119.It status_type
120.Bl -tag -width ".It GSS_C_MECH_CODE"
121.It GSS_C_GSS_CODE
122.Fa status_value
123is a GSS status code
124.It GSS_C_MECH_CODE
125.Fa status_value
126is a mechanism status code
127.El
128.It mech_type
129Underlying mechanism (used to interpret a minor status value).
130Supply
131.Dv GSS_C_NO_OID
132to obtain the system default.
133.It message_context
134Should be initialized to zero by the application prior to the first
135call.
136On return from
137.Fn gss_display_status ,
138a non-zero status_value parameter indicates that additional messages
139may be extracted from the status code via subsequent calls to
140.Fn gss_display_status ,
141passing the same
142.Fa status_value ,
143.Fa status_type ,
144.Fa mech_type ,
145and
146.Fa message_context
147parameters.
148.It status_string
149Textual interpretation of the
150.Fa status_value .
151Storage associated with this parameter must be freed by the
152application after use with a call to
153.Fn gss_release_buffer .
154.El
155.Sh RETURN VALUES
156.Bl -tag -width ".It GSS_S_BAD_STATUS"
157.It GSS_S_COMPLETE
158Successful completion
159.It GSS_S_BAD_MECH
160Indicates that translation in accordance with an unsupported mechanism
161type was requested
162.It GSS_S_BAD_STATUS
163The status value was not recognized, or the status type was neither
164.Dv GSS_C_GSS_CODE
165nor
166.Dv GSS_C_MECH_CODE .
167.El
168.Sh SEE ALSO
169.Xr gss_release_buffer 3
170.Sh STANDARDS
171.Bl -tag -width ".It RFC 2743"
172.It RFC 2743
173Generic Security Service Application Program Interface Version 2, Update 1
174.It RFC 2744
175Generic Security Service API Version 2 : C-bindings
176.El
177.Sh HISTORY
178The
179.Nm
180function first appeared in
181.Fx 7.0 .
182.Sh AUTHORS
183John Wray, Iris Associates
184.Sh COPYRIGHT
185Copyright (C) The Internet Society (2000).  All Rights Reserved.
186.Pp
187This document and translations of it may be copied and furnished to
188others, and derivative works that comment on or otherwise explain it
189or assist in its implementation may be prepared, copied, published
190and distributed, in whole or in part, without restriction of any
191kind, provided that the above copyright notice and this paragraph are
192included on all such copies and derivative works.  However, this
193document itself may not be modified in any way, such as by removing
194the copyright notice or references to the Internet Society or other
195Internet organizations, except as needed for the purpose of
196developing Internet standards in which case the procedures for
197copyrights defined in the Internet Standards process must be
198followed, or as required to translate it into languages other than
199English.
200.Pp
201The limited permissions granted above are perpetual and will not be
202revoked by the Internet Society or its successors or assigns.
203.Pp
204This document and the information contained herein is provided on an
205"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
206TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
207BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
208HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
209MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
210