From 8d14dc71f2729032c1f72a86213ed433d4279c31 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Mon, 1 Oct 2007 22:23:41 +0000 Subject: [PATCH] pull up r19967 from trunk r19967@cathode-dark-space: jaltman | 2007-09-24 08:30:03 -0400 ticket: new subject: NIM: BUG: khm_krb5_initialize() failed to return error code component: windows khm_krb5_initialize() is called in the krb5cred.dll and krb4cred.dll credential providers in order to ensure that the caller has references to a valid krb5_context and a valid krb5_ccache. If the krb5_cc_resolve() call failed, the error code was not being returned to the caller. Instead, success was returned which in turn would result in the caller believing the NULL krb5_ccache pointer was in fact valid. This fix resolves Microsoft's WER Event ID 432405961. ticket: 5763 version_fixed: 1.6.3 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@20044 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/plugins/common/krb5common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/windows/identity/plugins/common/krb5common.c b/src/windows/identity/plugins/common/krb5common.c index 1278fbcfa..36d647cc7 100644 --- a/src/windows/identity/plugins/common/krb5common.c +++ b/src/windows/identity/plugins/common/krb5common.c @@ -42,7 +42,7 @@ khm_krb5_error(krb5_error_code rc, LPCSTR FailedFunctionName, krb5_ccache * cache) { #ifdef NO_KRB5 - return 0; + return -1; #else #ifdef SHOW_MESSAGE_IN_AN_ANNOYING_WAY @@ -87,12 +87,12 @@ khm_krb5_initialize(khm_handle ident, krb5_ccache *cache) { #ifdef NO_KRB5 - return(0); + return(-1); #else LPCSTR functionName = NULL; int freeContextFlag = 0; - krb5_error_code rc = 0; + krb5_error_code rc = -1; krb5_flags flags = 0; if (pkrb5_init_context == NULL) @@ -132,7 +132,7 @@ khm_krb5_initialize(khm_handle ident, if(UnicodeStrToAnsi(ccname, sizeof(ccname), wccname) == 0) break; - if((*pkrb5_cc_resolve)(*ctx, ccname, cache)) { + if(rc = (*pkrb5_cc_resolve)(*ctx, ccname, cache)) { functionName = "krb5_cc_resolve()"; freeContextFlag = 1; goto on_error; -- 2.26.2