From df60b451138e76ba93f9693f32f5adf1f50377ca Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 9 Aug 2006 19:15:11 +0000 Subject: [PATCH] pull up r18259 from trunk r18259@cathode-dark-space: jaltman | 2006-06-28 21:48:31 -0400 ticket: new subject: gssapi compilation errors on Windows tags: pullup src/Makefile.in: generate lib/gssapi/spnego/Makefile src/lib/gssapi/Makefile.in: build mechglue and spnego src/lib/gssapi/krb5/init_sec_context.c: do not include kdc only symbols on windows src/lib/gssapi/mechglue/g_utils.c: no strings.h on Windows src/lib/gssapi/mechglue/Makefile.in: construct mechglue.lst src/lib/gssapi/spnego/Makefile.in: construct spnego.lst src/lib/gssapi/spnego/spnego_mech.c: k5-int.h must be included before krb5.h in order to prevent mixed definitions of time_t on windows ticket: 3956 version_fixed: 1.5.1 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18426 dc483132-0cff-0310-8789-dd5450dbe970 --- src/Makefile.in | 5 ++- src/lib/gssapi/Makefile.in | 22 +++++++++----- src/lib/gssapi/gss_libinit.c | 4 +++ src/lib/gssapi/krb5/init_sec_context.c | 14 +++++++-- src/lib/gssapi/mechglue/Makefile.in | 42 +++++++++++++++++++++++++- src/lib/gssapi/spnego/Makefile.in | 2 ++ src/lib/gssapi/spnego/spnego_mech.c | 1 + 7 files changed, 78 insertions(+), 12 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 0488b28ea..32f139b08 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -183,6 +183,7 @@ WINMAKEFILES=Makefile \ lib\des425\Makefile \ lib\gssapi\Makefile lib\gssapi\generic\Makefile \ lib\gssapi\krb5\Makefile lib\gssapi\mechglue\Makefile \ + lib\gssapi\spnego\Makefile \ lib\krb4\Makefile lib\krb5\Makefile \ lib\krb5\asn.1\Makefile lib\krb5\ccache\Makefile \ lib\krb5\ccache\ccapi\Makefile \ @@ -268,6 +269,8 @@ WINMAKEFILES=Makefile \ ##DOS## $(WCONFIG) config < $@.in > $@ ##DOS##lib\gssapi\mechglue\Makefile: lib\gssapi\mechglue\Makefile.in $(MKFDEP) ##DOS## $(WCONFIG) config < $@.in > $@ +##DOS##lib\gssapi\spnego\Makefile: lib\gssapi\spnego\Makefile.in $(MKFDEP) +##DOS## $(WCONFIG) config < $@.in > $@ ##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP) ##DOS## $(WCONFIG) config < $@.in > $@ ##DOS##lib\krb4\Makefile: lib\krb4\Makefile.in $(MKFDEP) @@ -366,7 +369,7 @@ FILES= ./* \ lib/crypto/sha1/* lib/crypto/arcfour/* lib/crypto/md4/* \ lib/crypto/md5/* lib/crypto/yarrow/* \ lib/des425/* lib/gssapi/* lib/gssapi/generic/* lib/gssapi/krb5/* \ - lib/gssapi/mechglue/* lib/krb4/* \ + lib/gssapi/mechglue/* lib/gssapi/spnego/* lib/krb4/* \ lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \ lib/krb5/ccache/* lib/krb5/ccache/ccapi/* \ lib/krb5/error_tables/* \ diff --git a/src/lib/gssapi/Makefile.in b/src/lib/gssapi/Makefile.in index b8568c7d5..02f5730ed 100644 --- a/src/lib/gssapi/Makefile.in +++ b/src/lib/gssapi/Makefile.in @@ -6,8 +6,8 @@ LOCAL_SUBDIRS= generic mechglue krb5 spnego DEFS= ##DOSLIBNAME=$(OUTPRE)gssapi.lib -##DOSOBJFILELIST=@$(OUTPRE)generic.lst @$(OUTPRE)krb5.lst @$(OUTPRE)gssapi.lst -##DOSOBJFILEDEP=$(OUTPRE)generic.lst $(OUTPRE)krb5.lst $(OUTPRE)gssapi.lst +##DOSOBJFILELIST=@$(OUTPRE)mechglue.lst @$(OUTPRE)spnego.lst @$(OUTPRE)generic.lst @$(OUTPRE)krb5.lst @$(OUTPRE)gssapi.lst +##DOSOBJFILEDEP=$(OUTPRE)mechglue.lst $(OUTPRE)spnego.lst $(OUTPRE)generic.lst $(OUTPRE)krb5.lst $(OUTPRE)gssapi.lst ##DOSOBJFILE=$(OUTPRE)gssapi.lst ##DOSLIBOBJS=$(OBJS) @@ -54,9 +54,12 @@ all-windows:: cd ..\krb5 @echo Making in gssapi\krb5 $(MAKE) -$(MFLAGS) -# cd ..\mechglue -# @echo Making in gssapi\mechglue -# $(MAKE) -$(MFLAGS) + cd ..\mechglue + @echo Making in gssapi\mechglue + $(MAKE) -$(MFLAGS) + cd ..\spnego + @echo Making in gssapi\spnego + $(MAKE) -$(MFLAGS) cd .. clean-windows:: @@ -66,9 +69,12 @@ clean-windows:: cd ..\krb5 @echo Making clean in gssapi\krb5 $(MAKE) -$(MFLAGS) clean -# cd ..\mechglue -# @echo Making clean in gssapi\mechglue -# $(MAKE) -$(MFLAGS) clean + cd ..\mechglue + @echo Making clean in gssapi\mechglue + $(MAKE) -$(MFLAGS) clean + cd ..\spnego + @echo Making clean in gssapi\spnego + $(MAKE) -$(MFLAGS) clean cd .. @echo Making clean in gssapi diff --git a/src/lib/gssapi/gss_libinit.c b/src/lib/gssapi/gss_libinit.c index 16031e26e..f075fe481 100644 --- a/src/lib/gssapi/gss_libinit.c +++ b/src/lib/gssapi/gss_libinit.c @@ -40,9 +40,11 @@ int gssint_lib_init(void) err = k5_key_register(K5_KEY_GSS_KRB5_CCACHE_NAME, free); if (err) return err; +#ifndef _WIN32 err = k5_mutex_finish_init(&kg_kdc_flag_mutex); if (err) return err; +#endif return k5_mutex_finish_init(&kg_vdb.mutex); } @@ -64,7 +66,9 @@ void gssint_lib_fini(void) k5_key_delete(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME); k5_key_delete(K5_KEY_GSS_KRB5_CCACHE_NAME); k5_mutex_destroy(&kg_vdb.mutex); +#ifndef _WIN32 k5_mutex_destroy(&kg_kdc_flag_mutex); +#endif k5_mutex_destroy(&gssint_krb5_keytab_lock); gssint_mechglue_fini(); } diff --git a/src/lib/gssapi/krb5/init_sec_context.c b/src/lib/gssapi/krb5/init_sec_context.c index 6d27fd33c..81b49f2c7 100644 --- a/src/lib/gssapi/krb5/init_sec_context.c +++ b/src/lib/gssapi/krb5/init_sec_context.c @@ -970,29 +970,37 @@ krb5_gss_init_sec_context(minor_status, claimant_cred_handle, return(major_status); } +#ifndef _WIN32 k5_mutex_t kg_kdc_flag_mutex = K5_MUTEX_PARTIAL_INITIALIZER; static int kdc_flag = 0; +#endif krb5_error_code krb5_gss_init_context (krb5_context *ctxp) { krb5_error_code err; +#ifndef _WIN32 int is_kdc; +#endif err = gssint_initialize_library(); if (err) return err; +#ifndef _WIN32 err = k5_mutex_lock(&kg_kdc_flag_mutex); if (err) return err; is_kdc = kdc_flag; k5_mutex_unlock(&kg_kdc_flag_mutex); + if (is_kdc) return krb5int_init_context_kdc(ctxp); - else - return krb5_init_context(ctxp); +#endif + + return krb5_init_context(ctxp); } +#ifndef _WIN32 krb5_error_code krb5_gss_use_kdc_context() { @@ -1008,3 +1016,5 @@ krb5_gss_use_kdc_context() k5_mutex_unlock(&kg_kdc_flag_mutex); return 0; } +#endif + diff --git a/src/lib/gssapi/mechglue/Makefile.in b/src/lib/gssapi/mechglue/Makefile.in index d49e78f5e..fe7d30195 100644 --- a/src/lib/gssapi/mechglue/Makefile.in +++ b/src/lib/gssapi/mechglue/Makefile.in @@ -6,7 +6,8 @@ LOCALINCLUDES = -I. -I$(srcdir) -I$(srcdir)/.. -I../generic -I$(srcdir)/../gener DEFS= ##DOSBUILDTOP = ..\..\.. -##DOSLIBNAME=..\$(OUTPRE)gssapi.$(LIBEXT) +##DOS##PREFIXDIR=mechglue +##DOS##OBJFILE=..\$(OUTPRE)mechglue.lst ##DOS##DLL_EXP_TYPE=GSS @@ -44,6 +45,41 @@ SRCS = \ $(srcdir)/g_verify.c \ $(srcdir)/oid_ops.c +OBJS = \ + $(OUTPRE)g_accept_sec_context.$(OBJEXT) \ + $(OUTPRE)g_acquire_cred.$(OBJEXT) \ + $(OUTPRE)g_canon_name.$(OBJEXT) \ + $(OUTPRE)g_compare_name.$(OBJEXT) \ + $(OUTPRE)g_context_time.$(OBJEXT) \ + $(OUTPRE)g_delete_sec_context.$(OBJEXT) \ + $(OUTPRE)g_dsp_name.$(OBJEXT) \ + $(OUTPRE)g_dsp_status.$(OBJEXT) \ + $(OUTPRE)g_dup_name.$(OBJEXT) \ + $(OUTPRE)g_exp_sec_context.$(OBJEXT) \ + $(OUTPRE)g_export_name.$(OBJEXT) \ + $(OUTPRE)g_glue.$(OBJEXT) \ + $(OUTPRE)g_imp_name.$(OBJEXT) \ + $(OUTPRE)g_imp_sec_context.$(OBJEXT) \ + $(OUTPRE)g_init_sec_context.$(OBJEXT) \ + $(OUTPRE)g_initialize.$(OBJEXT) \ + $(OUTPRE)g_inq_context.$(OBJEXT) \ + $(OUTPRE)g_inq_cred.$(OBJEXT) \ + $(OUTPRE)g_inq_names.$(OBJEXT) \ + $(OUTPRE)g_mechname.$(OBJEXT) \ + $(OUTPRE)g_oid_ops.$(OBJEXT) \ + $(OUTPRE)g_process_context.$(OBJEXT) \ + $(OUTPRE)g_rel_buffer.$(OBJEXT) \ + $(OUTPRE)g_rel_cred.$(OBJEXT) \ + $(OUTPRE)g_rel_name.$(OBJEXT) \ + $(OUTPRE)g_rel_oid_set.$(OBJEXT) \ + $(OUTPRE)g_seal.$(OBJEXT) \ + $(OUTPRE)g_sign.$(OBJEXT) \ + $(OUTPRE)g_store_cred.$(OBJEXT) \ + $(OUTPRE)g_unseal.$(OBJEXT) \ + $(OUTPRE)g_utils.$(OBJEXT) \ + $(OUTPRE)g_verify.$(OBJEXT) \ + $(OUTPRE)oid_ops.$(OBJEXT) + STLIBOBJS = \ g_accept_sec_context.o \ g_acquire_cred.o \ @@ -81,8 +117,12 @@ STLIBOBJS = \ EHDRDIR= $(BUILDTOP)$(S)include$(S)gssapi EXPORTED_HEADERS = mechglue.h +$(OBJS): $(EXPORTED_HEADERS) + all-unix:: all-libobjs +##DOS##LIBOBJS = $(OBJS) + clean-unix:: clean-libobjs # Krb5InstallHeaders($(EXPORTED_HEADERS), $(KRB5_INCDIR)/krb5) diff --git a/src/lib/gssapi/spnego/Makefile.in b/src/lib/gssapi/spnego/Makefile.in index 07561f6c8..cb1012f1e 100644 --- a/src/lib/gssapi/spnego/Makefile.in +++ b/src/lib/gssapi/spnego/Makefile.in @@ -18,6 +18,8 @@ STLIBOBJS = spnego_mech.o all-unix:: all-libobjs +##DOS##LIBOBJS = $(OBJS) + clean-unix:: clean-libobjs @libobj_frag@ diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c index 19a2a8b4a..0db0b5f92 100644 --- a/src/lib/gssapi/spnego/spnego_mech.c +++ b/src/lib/gssapi/spnego/spnego_mech.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include "gssapiP_spnego.h" -- 2.26.2