check return value from gssapi_krb5_init

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11534 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-10-31 16:06:35 +00:00
parent 2f7a5f8aae
commit 14d8cdb894
32 changed files with 764 additions and 748 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -38,7 +38,7 @@ RCSID("$Id$");
krb5_keytab gssapi_krb5_keytab;
OM_uint32
gsskrb5_register_acceptor_identity (char *identity)
gsskrb5_register_acceptor_identity (const char *identity)
{
krb5_error_code ret;
char *p;
@@ -77,7 +77,7 @@ gss_accept_sec_context
)
{
krb5_error_code kret;
OM_uint32 ret;
OM_uint32 ret = GSS_S_COMPLETE;
krb5_data indata;
krb5_flags ap_options;
OM_uint32 flags;
@@ -86,8 +86,7 @@ gss_accept_sec_context
krb5_data fwd_data;
OM_uint32 minor;
ret = 0;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT();
krb5_data_zero (&fwd_data);
output_token->length = 0;

View File

@@ -195,7 +195,7 @@ OM_uint32 gss_acquire_cred
gss_cred_id_t handle;
OM_uint32 ret;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
*minor_status = 0;
handle = (gss_cred_id_t)malloc(sizeof(*handle));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -42,7 +42,8 @@ OM_uint32 gss_compare_name
int * name_equal
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT();
*name_equal = krb5_principal_compare (gssapi_krb5_context,
name1, name2);
return GSS_S_COMPLETE;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -46,7 +46,7 @@ OM_uint32 gss_context_time
krb5_error_code kret;
krb5_timestamp timeret;
gssapi_krb5_init();
GSSAPI_KRB5_INIT ();
ret = gss_inquire_context(minor_status, context_handle,
NULL, NULL, &lifetime, NULL, NULL, NULL, NULL);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -41,7 +41,7 @@ OM_uint32 gss_delete_sec_context
gss_buffer_t output_token
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (output_token) {
output_token->length = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -46,7 +46,7 @@ OM_uint32 gss_display_name
char *buf;
size_t len;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
kret = krb5_unparse_name (gssapi_krb5_context,
input_name,
&buf);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1998 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -117,7 +117,7 @@ OM_uint32 gss_display_status
{
char *buf;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
*minor_status = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -43,7 +43,7 @@ OM_uint32 gss_duplicate_name (
{
krb5_error_code kret;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
kret = krb5_copy_principal (gssapi_krb5_context,
src_name,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1999 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -51,7 +51,7 @@ gss_export_sec_context (
OM_uint32 minor;
krb5_error_code kret;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (!((*context_handle)->flags & GSS_C_TRANS_FLAG))
return GSS_S_UNAVAILABLE;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -763,7 +763,7 @@ OM_uint32 gss_unseal
*/
OM_uint32 gsskrb5_register_acceptor_identity
(char *identity);
(const char *identity);
OM_uint32 gss_krb5_copy_ccache
(OM_uint32 *minor,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -50,6 +50,14 @@ extern krb5_keytab gssapi_krb5_keytab;
krb5_error_code gssapi_krb5_init (void);
#define GSSAPI_KRB5_INIT() do { \
krb5_error_code kret; \
if((kret = gssapi_krb5_init ()) != 0) { \
*minor_status = kret; \
return GSS_S_FAILURE; \
} \
} while (0)
OM_uint32
gssapi_krb5_create_8003_checksum (
OM_uint32 *minor_status,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -142,7 +142,7 @@ OM_uint32 gss_import_name
gss_name_t * output_name
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (oid_equal(input_name_type, GSS_C_NT_HOSTBASED_SERVICE))
return import_hostbased_name (minor_status,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1999 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -55,7 +55,7 @@ gss_import_sec_context (
int32_t flags;
OM_uint32 minor;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
sp = krb5_storage_from_mem (interprocess_token->value,
interprocess_token->length);

View File

@@ -503,7 +503,7 @@ OM_uint32 gss_init_sec_context
OM_uint32 * time_rec
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (input_token == GSS_C_NO_BUFFER || input_token->length == 0)
return init_auth (minor_status,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -38,7 +38,7 @@ RCSID("$Id$");
krb5_keytab gssapi_krb5_keytab;
OM_uint32
gsskrb5_register_acceptor_identity (char *identity)
gsskrb5_register_acceptor_identity (const char *identity)
{
krb5_error_code ret;
char *p;
@@ -77,7 +77,7 @@ gss_accept_sec_context
)
{
krb5_error_code kret;
OM_uint32 ret;
OM_uint32 ret = GSS_S_COMPLETE;
krb5_data indata;
krb5_flags ap_options;
OM_uint32 flags;
@@ -86,8 +86,7 @@ gss_accept_sec_context
krb5_data fwd_data;
OM_uint32 minor;
ret = 0;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT();
krb5_data_zero (&fwd_data);
output_token->length = 0;

View File

@@ -195,7 +195,7 @@ OM_uint32 gss_acquire_cred
gss_cred_id_t handle;
OM_uint32 ret;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
*minor_status = 0;
handle = (gss_cred_id_t)malloc(sizeof(*handle));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -42,7 +42,8 @@ OM_uint32 gss_compare_name
int * name_equal
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT();
*name_equal = krb5_principal_compare (gssapi_krb5_context,
name1, name2);
return GSS_S_COMPLETE;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -46,7 +46,7 @@ OM_uint32 gss_context_time
krb5_error_code kret;
krb5_timestamp timeret;
gssapi_krb5_init();
GSSAPI_KRB5_INIT ();
ret = gss_inquire_context(minor_status, context_handle,
NULL, NULL, &lifetime, NULL, NULL, NULL, NULL);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -41,7 +41,7 @@ OM_uint32 gss_delete_sec_context
gss_buffer_t output_token
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (output_token) {
output_token->length = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -46,7 +46,7 @@ OM_uint32 gss_display_name
char *buf;
size_t len;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
kret = krb5_unparse_name (gssapi_krb5_context,
input_name,
&buf);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1998 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -117,7 +117,7 @@ OM_uint32 gss_display_status
{
char *buf;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
*minor_status = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -43,7 +43,7 @@ OM_uint32 gss_duplicate_name (
{
krb5_error_code kret;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
kret = krb5_copy_principal (gssapi_krb5_context,
src_name,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1999 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -51,7 +51,7 @@ gss_export_sec_context (
OM_uint32 minor;
krb5_error_code kret;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (!((*context_handle)->flags & GSS_C_TRANS_FLAG))
return GSS_S_UNAVAILABLE;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -763,7 +763,7 @@ OM_uint32 gss_unseal
*/
OM_uint32 gsskrb5_register_acceptor_identity
(char *identity);
(const char *identity);
OM_uint32 gss_krb5_copy_ccache
(OM_uint32 *minor,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -50,6 +50,14 @@ extern krb5_keytab gssapi_krb5_keytab;
krb5_error_code gssapi_krb5_init (void);
#define GSSAPI_KRB5_INIT() do { \
krb5_error_code kret; \
if((kret = gssapi_krb5_init ()) != 0) { \
*minor_status = kret; \
return GSS_S_FAILURE; \
} \
} while (0)
OM_uint32
gssapi_krb5_create_8003_checksum (
OM_uint32 *minor_status,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -142,7 +142,7 @@ OM_uint32 gss_import_name
gss_name_t * output_name
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (oid_equal(input_name_type, GSS_C_NT_HOSTBASED_SERVICE))
return import_hostbased_name (minor_status,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1999 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -55,7 +55,7 @@ gss_import_sec_context (
int32_t flags;
OM_uint32 minor;
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
sp = krb5_storage_from_mem (interprocess_token->value,
interprocess_token->length);

View File

@@ -503,7 +503,7 @@ OM_uint32 gss_init_sec_context
OM_uint32 * time_rec
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if (input_token == GSS_C_NO_BUFFER || input_token->length == 0)
return init_auth (minor_status,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -44,7 +44,7 @@ OM_uint32 gss_release_cred
return GSS_S_COMPLETE;
}
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if ((*cred_handle)->principal != NULL)
krb5_free_principal(gssapi_krb5_context, (*cred_handle)->principal);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -40,7 +40,7 @@ OM_uint32 gss_release_name
gss_name_t * input_name
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
krb5_free_principal(gssapi_krb5_context,
*input_name);
*input_name = GSS_C_NO_NAME;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -44,7 +44,7 @@ OM_uint32 gss_release_cred
return GSS_S_COMPLETE;
}
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
if ((*cred_handle)->principal != NULL)
krb5_free_principal(gssapi_krb5_context, (*cred_handle)->principal);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -40,7 +40,7 @@ OM_uint32 gss_release_name
gss_name_t * input_name
)
{
gssapi_krb5_init ();
GSSAPI_KRB5_INIT ();
krb5_free_principal(gssapi_krb5_context,
*input_name);
*input_name = GSS_C_NO_NAME;