From d5f840aa7f91edda4f7a9122e1ebf38bbf1bbbe0 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 8 Dec 2003 20:24:33 +0000 Subject: [PATCH] 2003-11-26 Jeffrey Altman * cc_default.c: Add support for Leash Kinit Dialog on Windows to krb5int_c_default() ticket: 2028 target_version: 1.3.2 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15870 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/ChangeLog | 5 +++++ src/lib/krb5/ccache/ccdefault.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog index 4d6ea3149..9bfb82fac 100644 --- a/src/lib/krb5/ccache/ChangeLog +++ b/src/lib/krb5/ccache/ChangeLog @@ -1,3 +1,8 @@ +2003-11-26 Jeffrey Altman + + * cc_default.c: Add support for Leash Kinit Dialog on Windows to + krb5int_c_default() + 2003-08-26 Ken Raeburn * cc_file.c (krb5_fcc_store_int32, krb5_fcc_store_ui_4) diff --git a/src/lib/krb5/ccache/ccdefault.c b/src/lib/krb5/ccache/ccdefault.c index 71e6f9c9a..3dfb1a32c 100644 --- a/src/lib/krb5/ccache/ccdefault.c +++ b/src/lib/krb5/ccache/ccdefault.c @@ -31,6 +31,11 @@ #ifdef USE_LOGIN_LIBRARY #include "KerberosLoginPrivate.h" +#else +#ifdef USE_LEASH +static void (*pLeash_AcquireInitialTicketsIfNeeded)(krb5_context,krb5_principal) = NULL; +static HANDLE hLeashDLL = INVALID_HANDLE_VALUE; +#endif #endif @@ -111,6 +116,29 @@ krb5int_cc_default(krb5_context context, krb5_ccache *ccache) if (desiredPrincipal != nil) KLDisposePrincipal (desiredPrincipal); } +#else +#ifdef USE_LEASH + + if ( hLeashDLL == INVALID_HANDLE_VALUE ) { + hLeashDLL = LoadLibrary("leashw32.dll"); + if ( hLeashDLL != INVALID_HANDLE_VALUE ) { + (FARPROC) pLeash_AcquireInitialTicketsIfNeeded = + GetProcAddress(hLeashDLL, "not_an_API_Leash_AcquireInitialTicketsIfNeeded"); + } + } + + if ( pLeash_AcquireInitialTicketsIfNeeded ) + { + krb5_os_context os_ctx; + + if (!context || context->magic != KV5M_CONTEXT) + return KV5M_CONTEXT; + + os_ctx = context->os_context; + + pLeash_AcquireInitialTicketsIfNeeded(context,os_ctx->default_ccprincipal); + } +#endif #endif return krb5_cc_default (context, ccache); -- 2.26.2