r7352: the internal heimdal build change. This changes quite a few things:
authorAndrew Tridgell <tridge@samba.org>
Tue, 7 Jun 2005 07:22:25 +0000 (07:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:45 +0000 (13:17 -0500)
 - if you want kerberos now, you need to unpack a lorikeet heimdal
   tree in source/heimdal/. If source/heimdal/ does not exist at
   configure time then all kerberos features are disabled. You cannot
   use an external kerberos library for now. That may change later.

 - moved lib/replace/ config stuff to lib/replace/ and create a
   lib/replace/replace.h. That allows the heimdal build to use our
   portability layer, and prevenets duplicate definitions of functions
   like strlcat()

 - if you do enable heimdal, then you will need to do 'make
   HEIMDAL_EXTERNAL' before you build Samba. That should be fixed once
   I explain the problem to jelmer (the problem is the inability to
   set a depend without also dragging in the object list of the
   dependency. We need this for building the heimdal asn1 compiler and
   et compiler.

 - disabled all of the m4 checks for external kerberos libraries. I
   left them in place in auth/kerberos/, but disabled it in
   configure.in

some of the heimdal_build/ code is still very rough, for example I
don't correctly detect the correct awk, flex, bison replacements for
heimdal_build/build_external.sh. I expect to fix that stuff up over
the next few days.
(This used to be commit d4648249b2c7fc8b5e7c0fc8d8f92ae043b5691f)

19 files changed:
source4/auth/gensec/config.m4
source4/auth/gensec/config.mk
source4/auth/kerberos/config.m4
source4/config.list
source4/configure.in
source4/heimdal_build/build_external.sh
source4/heimdal_build/config.h
source4/heimdal_build/config.m4
source4/heimdal_build/config.mk
source4/heimdal_build/krb5-types.h [new file with mode: 0644]
source4/include/includes.h
source4/include/system/kerberos.h
source4/kdc/config.m4
source4/kdc/config.mk
source4/kdc/kdc.h
source4/lib/basic.mk
source4/lib/replace/config.mk [new file with mode: 0644]
source4/lib/replace/replace.h [new file with mode: 0644]
source4/smbd/service.c

index 4565ce0b97157926ab2f8abe285da7049ca6834c..af17e896a493c796fd316447e207e546678852ab 100644 (file)
@@ -1,7 +1,7 @@
 SMB_MODULE_DEFAULT(gensec_krb5, NOT)
 SMB_MODULE_DEFAULT(gensec_gssapi, NOT)
 
-if test x"$SMB_EXT_LIB_ENABLE_KRB5" = x"YES"; then
+if test x"$HAVE_KRB5" = x"YES"; then
        # krb5 is now disabled at runtime, not build time
        SMB_MODULE_DEFAULT(gensec_krb5, STATIC)
        SMB_MODULE_DEFAULT(gensec_gssapi, STATIC)
index f8d1928585ee39d4b5f2b95f22ab084996a8976e..34587e2e45b81181e3ea179ebb9b729289838512 100644 (file)
@@ -14,8 +14,7 @@ REQUIRED_SUBSYSTEMS = \
 SUBSYSTEM = GENSEC
 INIT_FUNCTION = gensec_krb5_init
 INIT_OBJ_FILES = auth/gensec/gensec_krb5.o 
-REQUIRED_SUBSYSTEMS = NDR_KRB5PAC KERBEROS EXT_LIB_KRB5 AUTH
-
+REQUIRED_SUBSYSTEMS = NDR_KRB5PAC KERBEROS KERBEROS_LIB AUTH
 # End MODULE gensec_krb5
 ################################################
 
@@ -25,7 +24,7 @@ REQUIRED_SUBSYSTEMS = NDR_KRB5PAC KERBEROS EXT_LIB_KRB5 AUTH
 SUBSYSTEM = GENSEC
 INIT_FUNCTION = gensec_gssapi_init
 INIT_OBJ_FILES = auth/gensec/gensec_gssapi.o 
-REQUIRED_SUBSYSTEMS = EXT_LIB_KRB5 AUTH
+REQUIRED_SUBSYSTEMS = KERBEROS_LIB AUTH
 # End MODULE gensec_gssapi
 ################################################
 
index d88fc78554ac3980da7aa26d898c6897cc3a826b..bbb57bdd47c70a0bbf404f537e397f2f17f54f5d 100644 (file)
@@ -1,3 +1,5 @@
+# NOTE! this whole m4 file is disabled in configure.in for now
+
 #################################################
 # KRB5 support
 KRB5_CFLAGS=""
index d2184731bb6f59e0d5f2ef955bfe3b77bb5518ef..cc8262314cfb2d5b258d2c3507a0d84efa100da6 100644 (file)
@@ -1,4 +1,5 @@
 # master list of build config files for Samba4
+heimdal_build/config.mk
 dsdb/config.mk
 gtk/config.mk
 smbd/config.mk
@@ -45,4 +46,4 @@ libcli/security/config.mk
 lib/com/config.mk
 scripting/config.mk
 kdc/config.mk
-#heimdal/config.mk
+lib/replace/config.mk
index a2a85c2885f82861f8436fdf46bb20ad11dcb36c..57816d566a8e0d511203226bc6be547d69aeff6f 100644 (file)
@@ -9,7 +9,7 @@ AC_CONFIG_HEADER(include/config.h)
 
 sinclude(build/m4/env.m4)
 sinclude(build/m4/rewrite.m4)
-
+sinclude(heimdal_build/config.m4)
 sinclude(lib/popt/config.m4)
 sinclude(lib/iconv.m4)
 sinclude(lib/socket/config.m4)
@@ -20,7 +20,10 @@ sinclude(lib/ldb/sqlite3.m4)
 sinclude(lib/ldb/config.m4)
 sinclude(lib/events/config.m4)
 sinclude(lib/cmdline/config.m4)
-sinclude(auth/kerberos/config.m4)
+
+dnl disabled until we support external heimdal again
+dnl sinclude(auth/kerberos/config.m4)
+
 sinclude(auth/gensec/config.m4)
 sinclude(libcli/config.m4)
 sinclude(smbd/process_model.m4)
index 571298b1b37121605041df7600a6b759467fa13a..5ee2de27f9b23b0c38e790c5f0bd0401b57595f8 100755 (executable)
@@ -5,10 +5,13 @@
 
 TOP=`pwd`
 ASN1_COMPILE=$TOP/bin/asn1_compile
-ET_COMPILE=compile_et
+ET_COMPILE=$TOP/bin/compile_et
+
+# we need to substitute these correctly based on configure output
 FLEX=flex
 BISON=bison
-
+AWK=gawk
+CC=gcc
 
 build_asn1() {
     f=$1
@@ -16,7 +19,7 @@ build_asn1() {
 
     dir=`dirname $f`
     file=`basename $f`
-    echo Compiling $f
+    echo Building $f
     cd $dir && $ASN1_COMPILE $file $name || exit 1
     for f in *.x; do
        base=`basename $f .x`
@@ -29,7 +32,7 @@ build_et() {
     f=$1
     dir=`dirname $f`
     file=`basename $f`
-    echo Compiling $f
+    echo Building $f
     cd $dir && $ET_COMPILE $file || exit 1
     cd $TOP || exit 1
 }
@@ -39,7 +42,7 @@ build_lex() {
     dir=`dirname $f`
     file=`basename $f`
     base=`basename $f .l`
-    echo Compiling $f
+    echo Building $f
     cd $dir && $FLEX $file
     sed '/^#/ s|$base.yy\.c|$base.c|' $base.yy.c > $base.c
     cd $TOP || exit 1
@@ -50,24 +53,52 @@ build_bison() {
     dir=`dirname $f`
     file=`basename $f`
     base=`basename $f .y`
-    echo Compiling $f
+    echo Building $f
     cd $dir && $BISON -y -d $file
     sed -e "/^#/!b" -e "s|y\.tab\.h|$base.h|" y.tab.h > $base.h
     sed '/^#/ s|y\.tab\.c|$base.c|' y.tab.c > $base.c
     cd $TOP || exit 1
 }
 
+build_awk() {
+    f=$1
+    dir=`dirname $f`
+    file=`basename $f`
+    base=`basename $f .h.in`
+    echo Building $f
+    cd $dir && $AWK -f $base.awk $base.h.in > gen.c
+    $CC -I$TOP/heimdal_build -I$TOP -Iheimdal/lib/roken -DHAVE_CONFIG_H -o gen gen.c || exit 1
+    ./gen > $base.h || exit 1
+    rm -f gen gen.c
+    cd $TOP || exit 1
+}
+
+build_cp() {
+    f=$1
+    dir=`dirname $f`
+    file=`basename $f`
+    base=`basename $f in`
+    echo Building $f
+    echo cp $base"in" $base
+    cd $dir && cp $base"in" $base
+    cd $TOP || exit 1
+}
+
+build_cp heimdal/lib/roken/vis.hin
+build_lex heimdal/lib/asn1/lex.l
+build_lex heimdal/lib/com_err/lex.l
+build_bison heimdal/lib/com_err/parse.y
+build_bison heimdal/lib/asn1/parse.y
+build_awk heimdal/lib/roken/roken.h.in
+
+make bin/asn1_compile || exit 1
 build_asn1 heimdal/lib/hdb/hdb.asn1 hdb_asn1
 build_asn1 heimdal/lib/gssapi/spnego.asn1 spnego_asn1
 build_asn1 heimdal/lib/asn1/k5.asn1 krb5_asn1
 
-
+make bin/compile_et || exit 1
 build_et heimdal/lib/hdb/hdb_err.et
 build_et heimdal/lib/krb5/krb5_err.et
 build_et heimdal/lib/krb5/heim_err.et
 build_et heimdal/lib/krb5/k524_err.et
 build_et heimdal/lib/asn1/asn1_err.et
-
-build_lex heimdal/lib/asn1/lex.l
-
-build_bison heimdal/lib/asn1/parse.y
index 375239c459422fc4c6530a2e439c27ee1286370e..ba6da4b35d085c3ece4bfec7d110077482dfe1d6 100644 (file)
@@ -6,6 +6,8 @@
 /* bring in the samba4 config.h */
 #include "include/config.h"
 
+#ifdef HAVE_KRB5
+
 #define RCSID(msg) \
 static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
 
@@ -22,17 +24,52 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
 /* path to sysconf - should we force this to samba LIBDIR ? */
 #define SYSCONFDIR "/etc"
 
-#define KRB5
 
 /* Maximum values on all known systems */
 #define MaxHostNameLen (64+4)
 #define MaxPathLen (1024+4)
 
-#define HAVE_H_ERRNO
+#define VERSIONLIST {"Lorikeet-Heimdal, Modified for Samba4 0.7rc1"}
 
-#define HAVE_LONG_LONG 1
+/* even if we do have dlopen, we don't want heimdal using it */
+#undef HAVE_DLOPEN
 
-#define VERSIONLIST {"Lorikeet-Heimdal, Modified for Samba4 0.7rc1"}
+#define VERSION "Samba"
 
+#define ROKEN_LIB_FUNCTION
 
-#undef HAVE_DLOPEN
+/* these should be done with configure tests */
+#define HAVE_H_ERRNO
+#define HAVE_INET_ATON
+#define HAVE_LONG_LONG
+#define HAVE_GETHOSTNAME
+#define HAVE_SOCKLEN_T
+#define HAVE_GETNAMEINFO
+#define HAVE_STRUCT_WINSIZE
+#define HAVE_STRUCT_SOCKADDR_STORAGE
+#define HAVE_STRUCT_ADDRINFO
+#define HAVE_GAI_STRERROR
+
+/* setup correct defines for capabilities of our version of heimdal */
+#define KRB5
+#define HAVE_KRB5_SET_REAL_TIME
+#define HAVE_KRB5_LOG_CONTROL
+#define HAVE_KRB5_INITLOG
+#define HAVE_KRB5_ADDLOG_FUNC
+#define HAVE_KRB5_FREELOG
+#define HAVE_KRB5_SET_WARN_DEST
+#define HAVE_KRB5_LOG_FACILITY
+#define HAVE_KRB5_AUTH_CON_SETKEY
+#define HAVE_ADDR_TYPE_IN_KRB5_ADDRESS
+#define HAVE_KRB5_GET_PW_SALT
+#define HAVE_KRB5_STRING_TO_KEY_SALT
+#define HAVE_KRB5_GET_DEFAULT_IN_TKT_ETYPES
+#define HAVE_KRB5_SESSION_IN_CREDS
+#define HAVE_KRB5_KEYBLOCK_KEYVALUE
+#define HAVE_KRB5_C_ENCTYPE_COMPARE
+#define HAVE_KRB5_KT_FREE_ENTRY
+#define HAVE_KRB5_PRINCIPAL_GET_COMP_STRING
+
+#include <sys/types.h>
+#include "lib/replace/replace.h"
+#endif
index 7bdcbdb030a25401a82a4abac12d3b898c5dcfab..3b32d9b22e191cca0958f303c4ac270660b9771c 100644 (file)
@@ -4,3 +4,18 @@ AC_CHECK_HEADERS(sys/utsname.h termcap.h term.h timezone.h time.h ttyname.h)
 
 AC_CHECK_FUNCS(setitimer uname umask unsetenv socket sendmsg putenv atexit)
 
+# these are disabled unless heimdal is found below
+SMB_MODULE_DEFAULT(KERBEROS_LIB, NOT)
+SMB_BINARY_ENABLE(asn1_compile, NO)
+SMB_BINARY_ENABLE(compile_et, NO)
+
+# to enable kerberos, unpack a heimdal source tree in the heimdal directory
+# of the samba source tree
+if test -d heimdal; then
+       AC_DEFINE(HAVE_KRB5,1,[Whether kerberos is available])
+       CFLAGS="${CFLAGS} -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/gssapi -Iheimdal/lib/asn1 -Iheimdal/lib/com_err -Iheimdal/lib/hdb"
+       HAVE_KRB5=YES
+       SMB_MODULE_DEFAULT(KERBEROS_LIB, STATIC)
+       SMB_BINARY_ENABLE(asn1_compile, YES)
+       SMB_BINARY_ENABLE(compile_et, YES)
+fi
index 4ce95f26db6d0a857fdb46cb3cba6adc41403ac2..4d7e63877af2325ecfe8bb92ab24f52eb03f7c98 100644 (file)
@@ -311,15 +311,13 @@ ADD_OBJ_FILES = \
        heimdal/lib/asn1/hash.o \
        heimdal/lib/asn1/lex.o \
        heimdal/lib/asn1/parse.o \
-       heimdal/lib/roken/strlcat.o \
-       heimdal/lib/roken/strlcpy.o \
        heimdal/lib/roken/emalloc.o \
        heimdal/lib/roken/getarg.o \
        heimdal/lib/roken/print_version.o \
        heimdal/lib/roken/setprogname.o \
        heimdal/lib/asn1/symbol.o
-TARGET_CFLAGS = -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/kdc -Iheimdal/lib/asn1 -Iheimdal/lib/des -Iheimdal/lib/com_err -Iheimdal/include 
 REQUIRED_SUBSYSTEMS = HEIMDAL_ROKEN
+TARGET_CFLAGS = -Iheimdal_build -Iheimdal/lib/roken
 NOPROTO = YES
 # End SUBSYSTEM ASN1_COMPILER
 #######################
@@ -327,12 +325,37 @@ NOPROTO = YES
 #######################
 # Start BINARY asn1_compile
 [BINARY::asn1_compile]
-REQUIRED_SUBSYSTEMS = ASN1_COMPILER
-TARGET_CFLAGS = -Iheimdal/lib/krb5 -Iheimdal/kdc -Iheimdal/lib/asn1 -Iheimdal/lib/des -Iheimdal/lib/com_err -Iheimdal_build -Iheimdal/include 
+REQUIRED_SUBSYSTEMS = ASN1_COMPILER LIBREPLACE
 # End BINARY asn1_compile
 #######################
 
 
+#######################
+# Start SUBSYSTEM COMPILE_ET
+[SUBSYSTEM::COMPILE_ET]
+ADD_OBJ_FILES = \
+       heimdal/lib/com_err/lex.o \
+       heimdal/lib/com_err/parse.o \
+       heimdal/lib/com_err/compile_et.o \
+       heimdal/lib/roken/getarg.o \
+       heimdal/lib/roken/get_window_size.o \
+       heimdal/lib/roken/getprogname.o \
+       heimdal/lib/roken/strupr.o \
+       heimdal/lib/roken/print_version.o \
+       heimdal/lib/roken/setprogname.o
+TARGET_CFLAGS = -Iheimdal_build -Iheimdal/lib/roken
+NOPROTO = YES
+# End SUBSYSTEM COMPILE_ET
+#######################
+
+#######################
+# Start BINARY compile_et
+[BINARY::compile_et]
+REQUIRED_SUBSYSTEMS = COMPILE_ET LIBREPLACE
+# End BINARY compile_et
+#######################
+
+
 #######################
 # Start TARGET HEIMDAL_EXTERNAL
 [TARGET::HEIMDAL_EXTERNAL]
@@ -346,7 +369,7 @@ REQUIRED_SUBSYSTEMS = ASN1_COMPILER
 # Start SUBSYSTEM HEIMDAL
 [SUBSYSTEM::HEIMDAL]
 NOPROTO = YES
-TARGET_CFLAGS = -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/hdb -Iheimdal/lib/gssapi -Iheimdal/kdc -Iheimdal/lib/asn1 -Iheimdal/lib/des -Iheimdal/lib/com_err -Iheimdal/include 
+TARGET_CFLAGS = -Iheimdal_build -Iheimdal/kdc -Iheimdal/lib/des -Iheimdal/lib/roken -Iheimdal/include 
 REQUIRED_SUBSYSTEMS = \
                HEIMDAL_KDC HEIMDAL_HDB HEIMDAL_GSSAPI HEIMDAL_KRB5 \
                HEIMDAL_ASN1 HEIMDAL_DES HEIMDAL_ROKEN HEIMDAL_COM_ERR
@@ -357,6 +380,6 @@ REQUIRED_SUBSYSTEMS = \
 # Start SUBSYSTEM KERBEROS_LIB
 [SUBSYSTEM::KERBEROS_LIB]
 #REQUIRED_SUBSYSTEMS = EXT_LIB_KRB5
-REQUIRED_SUBSYSTEMS = HEIMDAL
+REQUIRED_SUBSYSTEMS = HEIMDAL LIBREPLACE
 # End SUBSYSTEM KERBEROS_LIB
 #######################
diff --git a/source4/heimdal_build/krb5-types.h b/source4/heimdal_build/krb5-types.h
new file mode 100644 (file)
index 0000000..68a8bc0
--- /dev/null
@@ -0,0 +1,17 @@
+/* krb5-types.h -- this file was generated for i686-pc-linux-gnu by
+                   $Id: bits.c,v 1.23 2005/01/05 15:22:02 lha Exp $ */
+
+#ifndef __krb5_types_h__
+#define __krb5_types_h__
+
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/bitypes.h>
+#include <sys/socket.h>
+
+
+typedef socklen_t krb5_socklen_t;
+#include <unistd.h>
+typedef ssize_t krb5_ssize_t;
+
+#endif /* __krb5_types_h__ */
index a72a961495130bd872ffea1b9a538fb9ed9972b7..9ecfd20422ba52b467f821829da4e7b5667273a3 100644 (file)
  * Define VOLATILE if needed.
  */
 
-#if defined(HAVE_VOLATILE)
-#define VOLATILE volatile
-#else
-#define VOLATILE
-#endif
-
 #define False (0)
 #define True (1)
 #define Auto (2)
@@ -143,14 +137,13 @@ extern int errno;
 #include "lib/com/com.h"
 #include "credentials.h"
 
+#include "lib/replace/replace.h"
+
+
 #define malloc_p(type) (type *)malloc(sizeof(type))
 #define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
 #define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
 
-#ifndef HAVE_COMPARISON_FN_T
-typedef int (*comparison_fn_t)(const void *, const void *);
-#endif
-
 /***** automatically generated prototypes *****/
 #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
 #include "proto.h"
@@ -161,86 +154,12 @@ typedef int (*comparison_fn_t)(const void *, const void *);
 
 #include "safe_string.h"
 
-#ifdef __COMPAR_FN_T
-#define QSORT_CAST (__compar_fn_t)
-#endif
-
-#ifndef QSORT_CAST
-#define QSORT_CAST (int (*)(const void *, const void *))
-#endif
-
 #ifndef HAVE_PIPE
 #define SYNC_DNS 1
 #endif
 
-#ifndef HAVE_STRDUP
-char *strdup(const char *s);
-#endif
-
-#ifndef HAVE_MEMMOVE
-void *memmove(void *dest,const void *src,int size);
-#endif
-
-#ifndef HAVE_MKTIME
-time_t mktime(struct tm *t);
-#endif
-
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *d, const char *s, size_t bufsize);
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t strlcat(char *d, const char *s, size_t bufsize);
-#endif
-
-#ifndef HAVE_STRNDUP
-char *strndup(const char *s, size_t n);
-#endif
-
-#ifndef HAVE_STRNLEN
-size_t strnlen(const char *s, size_t n);
-#endif
-
-#ifndef HAVE_STRTOUL
-unsigned long strtoul(const char *nptr, char **endptr, int base);
-#endif
-
-#ifndef HAVE_SETENV
-int setenv(const char *name, const char *value, int overwrite); 
-#endif
-
-#ifndef HAVE_VASPRINTF_DECL
-int vasprintf(char **ptr, const char *format, va_list ap);
-#endif
-
-#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
-#define bzero(a,b) memset((a),'\0',(b))
-#endif
-
 extern int DEBUGLEVEL;
 
-/* add varargs prototypes with printf checking */
-#ifndef HAVE_SNPRINTF_DECL
-int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
-#endif
-#ifndef HAVE_ASPRINTF_DECL
-int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
-#endif
-
-
-/* we used to use these fns, but now we have good replacements
-   for snprintf and vsnprintf */
-#define slprintf snprintf
-
-
-#ifdef HAVE_VA_COPY
-#define VA_COPY(dest, src) va_copy(dest, src)
-#elif defined(HAVE___VA_COPY)
-#define VA_COPY(dest, src) __va_copy(dest, src)
-#else
-#define VA_COPY(dest, src) (dest) = (src)
-#endif
-
 #if defined(VALGRIND)
 #define strlen(x) valgrind_strlen(x)
 #endif
@@ -275,10 +194,6 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #endif
 #define discard_const_p(type, ptr) ((type *)discard_const(ptr))
 
-#ifndef UINT16_MAX
-#define UINT16_MAX 65535
-#endif
-
 /*
   type safe varient of smb_xmalloc()
 */
index e0a926300ffa0c2cc79bae27c0c3fc2372d926f8..98457688f8f5164e9cebdc7759cb682485b723ee 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "heimdal_build/config.h"
 
-#ifdef HAVE_KRB5_H
-#include <krb5.h>
-#else
-#undef HAVE_KRB5
-#endif
-
-#if defined(HAVE_GSSAPI_H)
-# include <gssapi.h>
-# ifdef HAVE_GSSAPI_KRB5_H
-#  include <gssapi_krb5.h>
-# endif
-#elif defined(HAVE_GSSAPI_GSSAPI_H)
-# include <gssapi/gssapi.h>
-# if defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
-#  include <gssapi/gssapi_krb5.h>
-# endif
-#elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
-# include <gssapi/gssapi_generic.h>
-# if defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
-#  include <gssapi/gssapi_krb5.h>
-# endif
-#endif
-
-#ifdef HAVE_COM_ERR_H
-#include <com_err.h>
+#ifdef HAVE_KRB5
+#include "heimdal/lib/krb5/krb5.h"
+#include "heimdal/lib/gssapi/gssapi.h"
+#include "heimdal/lib/com_err/com_err.h"
 #endif
index 1408a858f4ab75b9c4946b61c05e1b1f37d50683..c086b27936e09f14122d6d958cca7eb0d791d090 100644 (file)
@@ -1,5 +1,5 @@
 SMB_MODULE_DEFAULT(server_service_kdc, NOT)
 
-if test t$SMB_EXT_LIB_ENABLE_KDC = tYES; then
+if test t$HAVE_KRB5 = tYES; then
        SMB_MODULE_DEFAULT(server_service_kdc, STATIC)
 fi
index 3b227584ff6ea847dfd9bb3741de6b90f55b1be3..b1de650faa5e94d76752292af2fde157d23aef2f 100644 (file)
@@ -7,6 +7,6 @@ INIT_OBJ_FILES = \
                kdc/kdc.o \
                kdc/hdb-ldb.o
 REQUIRED_SUBSYSTEMS = \
-               LIBLDB EXT_LIB_KRB5 EXT_LIB_KDC
+               LIBLDB KERBEROS_LIB
 # End SUBSYSTEM KDC
 #######################
index d766e21e6e444c6cbd18ebbfa26c67ca0fb8fb6a..25f643eadd54578184b95ceb30bfa990f95677d3 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "system/kerberos.h"
 #include "auth/kerberos/kerberos.h"
-#include <kdc.h>
+#include "heimdal/kdc/kdc.h"
 
 krb5_error_code hdb_ldb_create(krb5_context context, struct HDB **db, const char *arg);
 
index 02783366ca828100eaf4fa1099a6084f67eb9fa2..6a463b8ec688bb22f966a0b208249ddacba9a257 100644 (file)
@@ -1,14 +1,5 @@
 # LIB BASIC subsystem
 
-##############################
-# Start SUBSYSTEM LIBREPLACE
-[SUBSYSTEM::LIBREPLACE]
-INIT_OBJ_FILES = lib/replace/replace.o
-ADD_OBJ_FILES = \
-               lib/replace/snprintf.o
-# End SUBSYSTEM LIBREPLACE
-##############################
-
 ##############################
 # Start SUBSYSTEM LIBNETIF
 [SUBSYSTEM::LIBNETIF]
diff --git a/source4/lib/replace/config.mk b/source4/lib/replace/config.mk
new file mode 100644 (file)
index 0000000..bd60402
--- /dev/null
@@ -0,0 +1,9 @@
+##############################
+# Start SUBSYSTEM LIBREPLACE
+[SUBSYSTEM::LIBREPLACE]
+INIT_OBJ_FILES = lib/replace/replace.o
+ADD_OBJ_FILES = \
+               lib/replace/snprintf.o
+# End SUBSYSTEM LIBREPLACE
+##############################
+
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
new file mode 100644 (file)
index 0000000..e0cb142
--- /dev/null
@@ -0,0 +1,114 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   macros to go along with the lib/replace/ portability layer code
+
+   Copyright (C) Andrew Tridgell 2005
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _replace_h
+#define _replace_h
+
+#ifdef __COMPAR_FN_T
+#define QSORT_CAST (__compar_fn_t)
+#endif
+
+#ifndef QSORT_CAST
+#define QSORT_CAST (int (*)(const void *, const void *))
+#endif
+
+#ifndef HAVE_STRDUP
+char *strdup(const char *s);
+#endif
+
+#ifndef HAVE_MEMMOVE
+void *memmove(void *dest,const void *src,int size);
+#endif
+
+#ifndef HAVE_MKTIME
+time_t mktime(struct tm *t);
+#endif
+
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *d, const char *s, size_t bufsize);
+#endif
+
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *d, const char *s, size_t bufsize);
+#endif
+
+#ifndef HAVE_STRNDUP
+char *strndup(const char *s, size_t n);
+#endif
+
+#ifndef HAVE_STRNLEN
+size_t strnlen(const char *s, size_t n);
+#endif
+
+#ifndef HAVE_STRTOUL
+unsigned long strtoul(const char *nptr, char **endptr, int base);
+#endif
+
+#ifndef HAVE_SETENV
+int setenv(const char *name, const char *value, int overwrite); 
+#endif
+
+#ifndef HAVE_VASPRINTF_DECL
+int vasprintf(char **ptr, const char *format, va_list ap);
+#endif
+
+#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
+#define bzero(a,b) memset((a),'\0',(b))
+#endif
+
+/* add varargs prototypes with printf checking */
+#ifndef HAVE_SNPRINTF_DECL
+int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
+#endif
+#ifndef HAVE_ASPRINTF_DECL
+int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
+#endif
+
+
+/* we used to use these fns, but now we have good replacements
+   for snprintf and vsnprintf */
+#define slprintf snprintf
+
+
+#ifdef HAVE_VA_COPY
+#define VA_COPY(dest, src) va_copy(dest, src)
+#elif defined(HAVE___VA_COPY)
+#define VA_COPY(dest, src) __va_copy(dest, src)
+#else
+#define VA_COPY(dest, src) (dest) = (src)
+#endif
+
+#ifndef UINT16_MAX
+#define UINT16_MAX 65535
+#endif
+
+#if defined(HAVE_VOLATILE)
+#define VOLATILE volatile
+#else
+#define VOLATILE
+#endif
+
+#ifndef HAVE_COMPARISON_FN_T
+typedef int (*comparison_fn_t)(const void *, const void *);
+#endif
+
+#endif
index ab377dc29b2ea43e292ec32f3466ec9c4b9f6a01..09f7a63fe735c317a0f94951a051ce5a08093e2d 100644 (file)
@@ -91,6 +91,10 @@ NTSTATUS server_service_startup(struct event_context *event_ctx,
                NTSTATUS status;
 
                status = server_service_init(server_services[i], event_ctx, model_ops);
+               if (!NT_STATUS_IS_OK(status)) {
+                       DEBUG(0,("Failed to start service '%s' - %s\n", 
+                                server_services[i], nt_errstr(status)));
+               }
                NT_STATUS_NOT_OK_RETURN(status);
        }