17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate * Copyright 1993 by OpenVision Technologies, Inc.
3*55fea89dSDan Cross *
47c478bd9Sstevel@tonic-gate * Permission to use, copy, modify, distribute, and sell this software
57c478bd9Sstevel@tonic-gate * and its documentation for any purpose is hereby granted without fee,
67c478bd9Sstevel@tonic-gate * provided that the above copyright notice appears in all copies and
77c478bd9Sstevel@tonic-gate * that both that copyright notice and this permission notice appear in
87c478bd9Sstevel@tonic-gate * supporting documentation, and that the name of OpenVision not be used
97c478bd9Sstevel@tonic-gate * in advertising or publicity pertaining to distribution of the software
107c478bd9Sstevel@tonic-gate * without specific, written prior permission. OpenVision makes no
117c478bd9Sstevel@tonic-gate * representations about the suitability of this software for any
127c478bd9Sstevel@tonic-gate * purpose. It is provided "as is" without express or implied warranty.
13*55fea89dSDan Cross *
147c478bd9Sstevel@tonic-gate * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
157c478bd9Sstevel@tonic-gate * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
167c478bd9Sstevel@tonic-gate * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
177c478bd9Sstevel@tonic-gate * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
187c478bd9Sstevel@tonic-gate * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
197c478bd9Sstevel@tonic-gate * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
207c478bd9Sstevel@tonic-gate * PERFORMANCE OF THIS SOFTWARE.
217c478bd9Sstevel@tonic-gate */
227c478bd9Sstevel@tonic-gate
237c478bd9Sstevel@tonic-gate /*
24159d09a2SMark Phalan * $Id: disp_com_err_status.c 18721 2006-10-16 16:18:29Z epeisach $
257c478bd9Sstevel@tonic-gate */
267c478bd9Sstevel@tonic-gate
27ab9b2e15Sgtb #include "gssapiP_generic.h"
28159d09a2SMark Phalan #include "com_err.h"
29ab9b2e15Sgtb
30ab9b2e15Sgtb /* XXXX internationalization!! */
31ab9b2e15Sgtb
32ab9b2e15Sgtb /**/
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate static const char * const no_error = "No error";
357c478bd9Sstevel@tonic-gate
36ab9b2e15Sgtb /**/
37ab9b2e15Sgtb
38ab9b2e15Sgtb /* if status_type == GSS_C_GSS_CODE, return up to three error messages,
39ab9b2e15Sgtb for routine errors, call error, and status, in that order.
40ab9b2e15Sgtb message_context == 0 : print the routine error
41ab9b2e15Sgtb message_context == 1 : print the calling error
42ab9b2e15Sgtb message_context > 2 : print supplementary info bit (message_context-2)
43ab9b2e15Sgtb if status_type == GSS_C_MECH_CODE, return the output from error_message()
44ab9b2e15Sgtb */
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gate OM_uint32
g_display_com_err_status(minor_status,status_value,status_string)477c478bd9Sstevel@tonic-gate g_display_com_err_status(minor_status, status_value, status_string)
487c478bd9Sstevel@tonic-gate OM_uint32 *minor_status;
497c478bd9Sstevel@tonic-gate OM_uint32 status_value;
507c478bd9Sstevel@tonic-gate gss_buffer_t status_string;
517c478bd9Sstevel@tonic-gate {
527c478bd9Sstevel@tonic-gate status_string->length = 0;
537c478bd9Sstevel@tonic-gate status_string->value = NULL;
547c478bd9Sstevel@tonic-gate
557c478bd9Sstevel@tonic-gate if (! g_make_string_buffer(((status_value == 0)?no_error:
565e01956fSGlenn Barry error_message(status_value)),
575e01956fSGlenn Barry status_string)) {
587c478bd9Sstevel@tonic-gate *minor_status = ENOMEM;
597c478bd9Sstevel@tonic-gate return(GSS_S_FAILURE);
607c478bd9Sstevel@tonic-gate }
617c478bd9Sstevel@tonic-gate *minor_status = 0;
627c478bd9Sstevel@tonic-gate return(GSS_S_COMPLETE);
637c478bd9Sstevel@tonic-gate }
64