From 08a7da0a204ec86eaaec715010657affbd896805 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Thu, 13 Apr 2000 22:06:53 +0000 Subject: [PATCH] 2000-4-13 Alexandra Ellwood * init_os_ctx.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@12169 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 6 ++++++ src/lib/krb5/os/init_os_ctx.c | 22 ++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 768f1e3a9..c0dc2c574 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,9 @@ +2000-4-13 Alexandra Ellwood + + * init_os_ctx.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. + 2000-03-20 Miro Jurisic * def_realm.c (krb5_free_default_realm): Added, use to free diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index 48d8bc2ad..5222e6af8 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -404,7 +404,8 @@ krb5_os_init_context(ctx) os_ctx->usec_offset = 0; os_ctx->os_flags = 0; os_ctx->default_ccname = 0; - + os_ctx->default_ccprincipal = 0; + krb5_cc_set_default_name(ctx, NULL); retval = os_init_paths(ctx); @@ -519,17 +520,22 @@ krb5_os_free_context(ctx) if (!os_ctx) return; - if (os_ctx->default_ccname) { + if (os_ctx->default_ccname) { free(os_ctx->default_ccname); - os_ctx->default_ccname = 0; - } + os_ctx->default_ccname = 0; + } + + if (os_ctx->default_ccprincipal) { + krb5_free_principal (ctx, os_ctx->default_ccprincipal); + os_ctx->default_ccprincipal = 0; + } os_ctx->magic = 0; free(os_ctx); ctx->os_context = 0; - if (ctx->profile) { - profile_release(ctx->profile); - ctx->profile = 0; - } + if (ctx->profile) { + profile_release(ctx->profile); + ctx->profile = 0; + } } -- 2.26.2