From 0119ccd8e4eb704aa42de120381cc6e75a1e05de Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Fri, 22 May 2009 21:43:29 +0000 Subject: [PATCH] rxk5-1557-20090522 LICENSE IPL10 FIXES n/a Correct several variations on failure to include krb5 headers before inclusino of rxk5.h. ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== LICENSE IPL10 FIXES n/a Move global 'i' declaration and references under AFS_RXK5 as intended. ==================== LICENSE IPL10 FIXES n/a Add missing line continuation. --- src/afs/afs_init.c | 7 ++++++- src/aklog/aklog_main.c | 5 +++-- src/auth/rxk5_utilafs.c | 5 ++++- src/kauth/user.c | 2 +- src/libadmin/client/afs_clientAdmin.c | 8 ++++++++ src/libafs/MakefileProto.FBSD.in | 2 +- src/libafsrpc/linktest.c | 3 ++- src/ptserver/ptprocs.c | 2 +- src/ptserver/ptuser.c | 2 +- src/rxk5/rxk5.h | 2 +- src/rxk5/rxk5c.xg | 13 +++++++++++++ src/viced/host.c | 2 +- src/vlserver/vlserver.c | 9 +++++---- 13 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 5123af2e6a..8334456b0a 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -17,10 +17,15 @@ #include "afs/param.h" #ifdef AFS_RXK5 -#include #ifdef USING_K5SSL #include +#else +#ifdef USING_HEIMDAL +#undef u #endif +#include +#endif +#include #include void rxk5_OnetimeInit(); #endif diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c index 768b285ae7..873829219b 100644 --- a/src/aklog/aklog_main.c +++ b/src/aklog/aklog_main.c @@ -494,8 +494,8 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) ll_free_list(&badrealms, (void(*)(char*))free); ll_free_list(&princs_tried, NULL); - i = 0; #ifdef AFS_RXK5 + i = 0; if (rxk5 & FORCE_RXK5) { if (max_enc > 0) { service_list[i++] = afskey_k5; @@ -648,11 +648,12 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) retry++; else retry = 0; - +#ifdef AFS_RXK5 /* Evil: overload retry loop to try next principal */ if (status && service_list[++i]) { retry = 1 ; } +#endif } if (status != 0) { diff --git a/src/auth/rxk5_utilafs.c b/src/auth/rxk5_utilafs.c index f14435fbd7..c2d6a99b65 100644 --- a/src/auth/rxk5_utilafs.c +++ b/src/auth/rxk5_utilafs.c @@ -763,8 +763,12 @@ default_afs_rxk5_forge(krb5_context context, char *to_free = 0; int allowed_enctypes[] = { /* XXX needs work... */ +#ifdef ENCTYPE_AES256_CTS_HMAC_SHA1_96 ENCTYPE_AES256_CTS_HMAC_SHA1_96, +#endif +#ifdef ENCTYPE_AES128_CTS_HMAC_SHA1_96 ENCTYPE_AES128_CTS_HMAC_SHA1_96, +#endif ENCTYPE_DES3_CBC_SHA1, #ifdef USING_MIT #define ENCTYPE_ARCFOUR_HMAC_MD5 ENCTYPE_ARCFOUR_HMAC @@ -800,4 +804,3 @@ out: if (to_free) free(to_free); return code; } - diff --git a/src/kauth/user.c b/src/kauth/user.c index 2352f503fd..b2c7046f14 100644 --- a/src/kauth/user.c +++ b/src/kauth/user.c @@ -157,7 +157,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance, int remainingTime = 0; struct ktc_encryptionKey key; afs_int32 code, dosetpag = 0; -#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && !defined(AFS_XBSD_ENV) +#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && (!defined(AFS_XBSD_ENV) || defined(AFS_FBSD_ENV)) sig_t old; #endif diff --git a/src/libadmin/client/afs_clientAdmin.c b/src/libadmin/client/afs_clientAdmin.c index add91ec96e..a102dadf54 100644 --- a/src/libadmin/client/afs_clientAdmin.c +++ b/src/libadmin/client/afs_clientAdmin.c @@ -42,6 +42,14 @@ RCSID #include #include #ifdef AFS_RXK5 +#ifdef USING_K5SSL +#include +#else +#ifdef USING_HEIMDAL +#undef u +#endif +#include +#endif #include #ifdef USING_HEIMDAL #define EncryptionKey Heimdal_EncryptionKey_NotNeededHere diff --git a/src/libafs/MakefileProto.FBSD.in b/src/libafs/MakefileProto.FBSD.in index c6231a84ec..4cc1f42dcb 100644 --- a/src/libafs/MakefileProto.FBSD.in +++ b/src/libafs/MakefileProto.FBSD.in @@ -82,7 +82,7 @@ KDEFS=-Wall -nostdinc -I/usr/include -D_KERNEL -DKLD_MODULE \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 \ -mno-align-long-strings -fno-common -ffreestanding \ - -I${KBLD} -include opt_global.h -fno-strict-aliasing + -I${KBLD} -include opt_global.h -fno-strict-aliasing \ -I${TOP_SRCDIR}/rxk5 ${K5SSL_INC} \ diff --git a/src/libafsrpc/linktest.c b/src/libafsrpc/linktest.c index f76e567850..9beec71473 100644 --- a/src/libafsrpc/linktest.c +++ b/src/libafsrpc/linktest.c @@ -40,8 +40,9 @@ #include #include #include +#include #ifdef AFS_RXK5 - +#include #include #include diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index 279362c0eb..02e945d4b1 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -64,9 +64,9 @@ RCSID #include #include #ifdef AFS_RXK5 +#include #include #include -#include #include #endif #include diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index 8326d6a636..8152bf51dc 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -52,8 +52,8 @@ RCSID #include #include #ifdef AFS_RXK5 +#include #include -#include #include #endif #include "afs_token.h" diff --git a/src/rxk5/rxk5.h b/src/rxk5/rxk5.h index 2fb2147a7d..85cfde9817 100644 --- a/src/rxk5/rxk5.h +++ b/src/rxk5/rxk5.h @@ -82,7 +82,7 @@ struct rxk5_stats { #endif #endif #if defined(USING_MIT) || defined(USING_HEIMDAL) || defined(USING_K5SSL) -#ifdef KRB5_TC_MATCH_KTYPE +#if 1 /* KRB5_TC_MATCH_KTYPE */ #define RXK5_K5_CONTEXT krb5_context #define RXK5_K5_PRINCIPAL krb5_principal #define RXK5_K5_CREDS krb5_creds * diff --git a/src/rxk5/rxk5c.xg b/src/rxk5/rxk5c.xg index 8451973829..5ef52c00eb 100644 --- a/src/rxk5/rxk5c.xg +++ b/src/rxk5/rxk5c.xg @@ -28,6 +28,19 @@ * such damages. */ +%#include "rxk5c.h" + +%#ifdef AFS_RXK5 +%#ifdef USING_K5SSL +%#include +%#else +%#ifdef USING_HEIMDAL +%#undef u +%#endif +%#include +%#endif +%#endif + %#include %#ifndef TRUE diff --git a/src/viced/host.c b/src/viced/host.c index 793acafe8e..5875842de3 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -61,8 +61,8 @@ RCSID #include "../tviced/serialize_state.h" #endif /* AFS_DEMAND_ATTACH_FS */ #ifdef AFS_RXK5 -#include #include +#include #endif #ifdef AFS_PTHREAD_ENV diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 6eb60b1e12..5abc24bb5e 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -40,11 +40,12 @@ RCSID #include #include #include -#ifdef AFS_RXK5 -#include "rxk5.h" -#include "rxk5errors.h" -#endif #include +#ifdef AFS_RXK5 +#include +#include +#include +#endif #include #include #include