From: Jeffrey Altman Date: Thu, 8 Nov 2012 20:19:33 +0000 (-0500) Subject: Windows: Make krb4v32.dll and krb524.dll optional X-Git-Tag: upstream/1.6.2_pre2^2~25 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2c1ba63df3cd59f378dc3e62b4786a1aedaa3f2a;p=packages%2Fo%2Fopenafs.git Windows: Make krb4v32.dll and krb524.dll optional 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman (cherry picked from commit 3764cbfbc9f26738b5e6693e8729e79dbb0092c6) Change-Id: Ib546aa45a57bba40de02dc9499dd1ce6c2ef9d73 Reviewed-on: http://gerrit.openafs.org/8726 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index c71e146e8..00f72f294 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -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