disp_status.c revision ab9b2e153c3a9a2b1141fefa87925b1a9beb1236
2N/A/*
2N/A * Copyright 1993 by OpenVision Technologies, Inc.
2N/A *
2N/A * Permission to use, copy, modify, distribute, and sell this software
2N/A * and its documentation for any purpose is hereby granted without fee,
2N/A * provided that the above copyright notice appears in all copies and
2N/A * that both that copyright notice and this permission notice appear in
2N/A * supporting documentation, and that the name of OpenVision not be used
2N/A * in advertising or publicity pertaining to distribution of the software
2N/A * without specific, written prior permission. OpenVision makes no
2N/A * representations about the suitability of this software for any
2N/A * purpose. It is provided "as is" without express or implied warranty.
2N/A *
2N/A * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
2N/A * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
2N/A * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2N/A * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
2N/A * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2N/A * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2N/A * PERFORMANCE OF THIS SOFTWARE.
2N/A */
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#include "gssapiP_krb5.h"
2N/A#include "gss_libinit.h"
2N/A#include "com_err.h"
2N/A
2N/A/* XXXX internationalization!! */
2N/A
2N/A/**/
2N/A
2N/AOM_uint32
2N/Akrb5_gss_display_status(minor_status, status_value, status_type,
2N/A mech_type, message_context, status_string)
2N/A OM_uint32 *minor_status;
2N/A OM_uint32 status_value;
2N/A int status_type;
2N/A gss_OID mech_type;
2N/A OM_uint32 *message_context;
2N/A gss_buffer_t status_string;
2N/A{
2N/A status_string->length = 0;
2N/A status_string->value = NULL;
2N/A
2N/A if ((mech_type != GSS_C_NULL_OID) &&
2N/A !g_OID_equal(gss_mech_krb5, mech_type) &&
2N/A !g_OID_equal(gss_mech_krb5_old, mech_type)) {
2N/A *minor_status = 0;
2N/A return(GSS_S_BAD_MECH);
2N/A }
2N/A
2N/A if (status_type == GSS_C_GSS_CODE) {
2N/A return(g_display_major_status(minor_status, status_value,
2N/A message_context, status_string));
2N/A } else if (status_type == GSS_C_MECH_CODE) {
2N/A (void) gssint_initialize_library();
2N/A
2N/A if (*message_context) {
2N/A *minor_status = (OM_uint32) G_BAD_MSG_CTX;
2N/A return(GSS_S_FAILURE);
2N/A }
2N/A
2N/A return(g_display_com_err_status(minor_status, status_value,
2N/A status_string));
2N/A } else {
2N/A *minor_status = 0;
2N/A return(GSS_S_BAD_STATUS);
2N/A }
2N/A}
2N/A