svn rev #23876: branches/iakerb/src/lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Apr 8 12:51:58 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=23876
Commit By: ghudson
Log Message:
Use krb5_cc_dup to make a copy of the ccache handle passed to
krb5_tkt_creds_init(), so that ccache can be closed before the context
is freed.



Changed Files:
U   branches/iakerb/src/lib/krb5/krb/gc_frm_kdc.c
Modified: branches/iakerb/src/lib/krb5/krb/gc_frm_kdc.c
===================================================================
--- branches/iakerb/src/lib/krb5/krb/gc_frm_kdc.c	2010-04-08 16:41:17 UTC (rev 23875)
+++ branches/iakerb/src/lib/krb5/krb/gc_frm_kdc.c	2010-04-08 16:51:58 UTC (rev 23876)
@@ -891,8 +891,9 @@
     code = krb5_copy_principal(context, ctx->server, &ctx->req_server);
     if (code != 0)
         goto cleanup;
-    /* XXX Make an alias for now; use krb5_cc_dup later. */
-    ctx->ccache = ccache;
+    code = krb5_cc_dup(context, ccache, &ctx->ccache);
+    if (code != 0)
+        goto cleanup;
     ctx->req_kdcopt = kdcopt;
     code = krb5_copy_authdata(context, in_creds->authdata, &ctx->authdata);
     if (code != 0)
@@ -944,6 +945,7 @@
     if (ctx == NULL)
         return;
     krb5_free_creds(context, ctx->in_creds);
+    krb5_cc_close(context, ctx->ccache);
     krb5_free_principal(context, ctx->req_server);
     krb5_free_authdata(context, ctx->authdata);
     krb5_free_creds(context, ctx->cur_tgt);




More information about the cvs-krb5 mailing list