2003-11-26 Jeffrey Altman <jaltman@mit.edu>
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 8 Dec 2003 20:24:33 +0000 (20:24 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 8 Dec 2003 20:24:33 +0000 (20:24 +0000)
    * 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
src/lib/krb5/ccache/ccdefault.c

index 4d6ea3149bd76a565bc7bdc1525bdfcf4d309408..9bfb82facd85d99b1341e69c507a0eb56898ab6b 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-26  Jeffrey Altman <jaltman@mit.edu>
+
+    * cc_default.c: Add support for Leash Kinit Dialog on Windows to
+            krb5int_c_default()
+
 2003-08-26  Ken Raeburn  <raeburn@mit.edu>
 
        * cc_file.c (krb5_fcc_store_int32, krb5_fcc_store_ui_4) 
index 71e6f9c9a59f393ddec42b3bec4b05a15a6666ad..3dfb1a32cf51813c6e009ed3ede79903da11cb43 100644 (file)
 
 #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);