From 6b86bb400f2e33a59890001c14f67b54075481a2 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 29 Jun 2006 01:48:31 +0000 Subject: [PATCH] gssapi compilation errors on Windows 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: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18259 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/mechglue/g_utils.c | 2 ++ src/lib/gssapi/spnego/Makefile.in | 2 ++ src/lib/gssapi/spnego/spnego_mech.c | 1 + 8 files changed, 80 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 20012fe63..04fe9fa95 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) @@ -69,9 +69,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:: @@ -81,9 +84,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 4f49f0742..13f9bc953 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 @@ -45,6 +46,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 \ @@ -83,8 +119,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/mechglue/g_utils.c b/src/lib/gssapi/mechglue/g_utils.c index 82fe70d95..5bd6e1f64 100644 --- a/src/lib/gssapi/mechglue/g_utils.c +++ b/src/lib/gssapi/mechglue/g_utils.c @@ -9,7 +9,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include #include #include 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 ee1e73e59..68c003115 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 "gssapiP_spnego.h" #include -- 2.26.2