summaryrefslogtreecommitdiffstats
path: root/src/lib/gssapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/gssapi')
-rw-r--r--src/lib/gssapi/krb5/accept_sec_context.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c
index 42a86de6d2..77ab8df1e6 100644
--- a/src/lib/gssapi/krb5/accept_sec_context.c
+++ b/src/lib/gssapi/krb5/accept_sec_context.c
@@ -249,6 +249,7 @@ krb5_gss_accept_sec_context(minor_status, context_handle,
gss_cred_id_t cred_handle = NULL;
krb5_gss_cred_id_t deleg_cred = NULL;
krb5int_access kaccess;
+ int got_rcache = 0;
code = krb5int_accessor (&kaccess, KRB5INT_ACCESS_VERSION);
if (code) {
@@ -382,6 +383,7 @@ krb5_gss_accept_sec_context(minor_status, context_handle,
goto fail;
}
if (cred->rcache) {
+ got_rcache = 1;
if ((code = krb5_auth_con_setrcache(context, auth_context, cred->rcache))) {
major_status = GSS_S_FAILURE;
goto fail;
@@ -877,7 +879,9 @@ krb5_gss_accept_sec_context(minor_status, context_handle,
krb5_free_authenticator(context, authdat);
/* The ctx structure has the handle of the auth_context */
if (auth_context && !ctx) {
- (void)krb5_auth_con_setrcache(context, auth_context, NULL);
+ if (!got_rcache)
+ (void)krb5_auth_con_setrcache(context, auth_context, NULL);
+
krb5_auth_con_free(context, auth_context);
}
if (reqcksum.contents)