gssapi compilation errors on Windows
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 29 Jun 2006 01:48:31 +0000 (01:48 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 29 Jun 2006 01:48:31 +0000 (01:48 +0000)
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
src/lib/gssapi/Makefile.in
src/lib/gssapi/gss_libinit.c
src/lib/gssapi/krb5/init_sec_context.c
src/lib/gssapi/mechglue/Makefile.in
src/lib/gssapi/mechglue/g_utils.c
src/lib/gssapi/spnego/Makefile.in
src/lib/gssapi/spnego/spnego_mech.c

index 0488b28ead876316d19b242e6d14b63751b29556..32f139b08811a7a661c65db1fab9c98e64a71b91 100644 (file)
@@ -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/* \
index 20012fe6309fd6ab8500898cf753f0622a397e89..04fe9fa95fc96f1f16aa70b805b068a9d7a2398a 100644 (file)
@@ -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
 
index 16031e26efc8b6548abfeb9873e09664bfeb5e47..f075fe481e40cdf694a4627c39780fbe58272930 100644 (file)
@@ -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();
 }
index 6d27fd33cb64bfa59c20007f04bc78d37739c3bf..81b49f2c73c90327255f5104b6d4d9f64dbb631f 100644 (file)
@@ -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
+
index 4f49f074211e4b934fb33e7bb2a2148908e18450..13f9bc953bf98699a704e794612ade5cfcbda24e 100644 (file)
@@ -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)
index 82fe70d95b7860b0d4004c511fce7a6f089adc4e..5bd6e1f64944ea021a6ce17440c81ab96623f8c9 100644 (file)
@@ -9,7 +9,9 @@
 #include <sys/stat.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifndef _WIN32
 #include <strings.h>
+#endif
 #include <ctype.h>
 #include <errno.h>
 #include <gssapi/gssapi.h>
index 07561f6c81e4bfe5678e77b594630bd57d51ac8b..cb1012f1e28e880fad0d467e980ddb67e606210a 100644 (file)
@@ -18,6 +18,8 @@ STLIBOBJS = spnego_mech.o
 
 all-unix:: all-libobjs
 
+##DOS##LIBOBJS = $(OBJS)
+
 clean-unix:: clean-libobjs
 
 @libobj_frag@
index ee1e73e59cb3280da6ac5d9cb485f23be5203306..68c00311541e872e9d5cc4c7307693b978cd0bf7 100644 (file)
@@ -39,6 +39,7 @@
 #include       <stdio.h>
 #include       <stdlib.h>
 #include       <string.h>
+#include       <k5-int.h>
 #include       <krb5.h>
 #include       "gssapiP_spnego.h"
 #include       <mglueP.h>