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