]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: Make krb4v32.dll and krb524.dll optional
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 8 Nov 2012 20:19:33 +0000 (15:19 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 9 Dec 2012 06:02:21 +0000 (22:02 -0800)
Permit afskfw.dll to be built with USE_KRB4 and USE_KRB524 without
the requisite DLLs being available on the target machine.

Reviewed-on: http://gerrit.openafs.org/8413
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3764cbfbc9f26738b5e6693e8729e79dbb0092c6)

Change-Id: Ib546aa45a57bba40de02dc9499dd1ce6c2ef9d73
Reviewed-on: http://gerrit.openafs.org/8726
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsd/afskfw.c

index c71e146e80c10d681d435836bd97de2350c75d82..00f72f294df4ecdf4d2bfd3fc6221c1dc972d057 100644 (file)
@@ -453,7 +453,7 @@ KFW_initialize(void)
             LoadFuncs(COMERR_DLL, ce_fi, &hComErr, 0, 0, 1, 0);
             LoadFuncs(PROFILE_DLL, profile_fi, &hProfile, 0, 1, 0, 0);
 #ifdef USE_KRB4
-            LoadFuncs(KRB4_DLL, k4_fi, &hKrb4, 0, 1, 0, 0);
+            LoadFuncs(KRB4_DLL, k4_fi, &hKrb4, 0, 1, 1, 1);
 #endif /* USE_KRB4 */
             LoadFuncs(SERVICE_DLL, service_fi, &hService, 0, 1, 0, 0);
 #ifdef USE_MS2MIT
@@ -645,9 +645,6 @@ KFW_is_available(void)
 #ifdef USE_MS2MIT
          hSecur32 &&
 #endif /* USE_MS2MIT */
-#ifdef USE_KRB524
-         hKrb524 &&
-#endif
 #ifdef USE_LEASH
          hLeash &&
 #endif
@@ -2968,7 +2965,7 @@ KFW_AFS_klog(
 
   skip_krb5_init:
 #ifdef USE_KRB4
-    if ( !try_krb5 || !realm_of_user[0] ) {
+    if ( hKrb4 && (!try_krb5 || !realm_of_user[0]) ) {
         if ((rc = (*pkrb_get_tf_realm)((*ptkt_string)(), realm_of_user)) != KSUCCESS)
         {
             goto cleanup;
@@ -3305,6 +3302,9 @@ KFW_AFS_klog(
 #ifndef USE_KRB524
         goto cleanup;
 #else
+        if (hKrb524 == NULL)
+            goto cleanup;
+
         /* Otherwise, the ticket could have been too large so try to
          * convert using the krb524d running with the KDC
          */
@@ -3323,6 +3323,9 @@ KFW_AFS_klog(
     } else {
       use_krb4:
 #ifdef USE_KRB4
+        if (hKrb4 == NULL)
+            goto cleanup;
+
         code = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds);
         if (code == NO_TKT_FIL) {
             // if the problem is that we have no krb4 tickets