From ba7b3c85ece66970c5e5ce01c48243b8ed092d73 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Thu, 13 Apr 2000 22:05:57 +0000 Subject: [PATCH] 2000-4-13 Alexandra Ellwood * ccdefname.c: Added support to store a krb5_principal in the os_context along with the default ccache name (if known, this principal is the same as the last time we looked at the ccache. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12167 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ccdefname.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index 53e788859..3bc2546cb 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -261,6 +261,13 @@ krb5_cc_set_default_name(context, name) return ENOMEM; strcpy(new_name, name_buf); + if (!os_ctx->default_ccname || (strcmp(os_ctx->default_ccname, new_name) != 0)) { + /* the ccache changed... forget the old principal */ + if (os_ctx->default_ccprincipal) + krb5_free_principal (context, os_ctx->default_ccprincipal); + os_ctx->default_ccprincipal = 0; /* we don't care until we use it */ + } + if (os_ctx->default_ccname) free(os_ctx->default_ccname); -- 2.26.2