diff options
author | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
commit | 0c8fa354358381b3f1b92598e7f1b46f8cf744cc (patch) | |
tree | ed28ffb73cc0ae48a9892dab3f10b09bc36436d5 /crypto/heimdal/lib/krb5/verify_init.c | |
parent | 06c859ecf534f468a52f24a3eb14409d73a4907c (diff) | |
download | FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.zip FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.tar.gz |
import of heimdal 0.3f
Diffstat (limited to 'crypto/heimdal/lib/krb5/verify_init.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/verify_init.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/crypto/heimdal/lib/krb5/verify_init.c b/crypto/heimdal/lib/krb5/verify_init.c index e7945ad..7e4618e 100644 --- a/crypto/heimdal/lib/krb5/verify_init.c +++ b/crypto/heimdal/lib/krb5/verify_init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "krb5_locl.h" -RCSID("$Id: verify_init.c,v 1.12 2000/01/21 05:47:35 assar Exp $"); +RCSID("$Id: verify_init.c,v 1.14 2001/05/14 06:14:52 assar Exp $"); void krb5_verify_init_creds_opt_init(krb5_verify_init_creds_opt *options) @@ -79,7 +79,7 @@ krb5_verify_init_creds(krb5_context context, { krb5_error_code ret; krb5_data req; - krb5_ccache local_ccache; + krb5_ccache local_ccache = NULL; krb5_keytab_entry entry; krb5_creds *new_creds = NULL; krb5_auth_context auth_context = NULL; @@ -92,8 +92,12 @@ krb5_verify_init_creds(krb5_context context, if (ap_req_server == NULL) { char local_hostname[MAXHOSTNAMELEN]; - if (gethostname (local_hostname, sizeof(local_hostname)) < 0) - return errno; + if (gethostname (local_hostname, sizeof(local_hostname)) < 0) { + ret = errno; + krb5_set_error_string (context, "getsockname: %s", + strerror(ret)); + return ret; + } ret = krb5_sname_to_principal (context, local_hostname, @@ -185,8 +189,10 @@ cleanup: krb5_free_principal (context, server); if (ap_req_keytab == NULL && keytab) krb5_kt_close (context, keytab); - if (ccache == NULL - || (ret != 0 && *ccache == NULL)) + if (local_ccache != NULL + && + (ccache == NULL + || (ret != 0 && *ccache == NULL))) krb5_cc_destroy (context, local_ccache); if (ret == 0 && ccache != NULL && *ccache == NULL) |