summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/Makefile.in10
-rw-r--r--source4/lib/ldb/config.mk12
-rw-r--r--source4/lib/ldb/configure.in12
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_pack.c14
-rw-r--r--source4/lib/ldb/popt.m43
5 files changed, 23 insertions, 28 deletions
diff --git a/source4/lib/ldb/Makefile.in b/source4/lib/ldb/Makefile.in
index 9de1131f2b..51227a29ed 100644
--- a/source4/lib/ldb/Makefile.in
+++ b/source4/lib/ldb/Makefile.in
@@ -12,7 +12,6 @@ VPATH = @srcdir@:@srcdir@/..:@POPTDIR@
srcdir = @srcdir@
builddir = @builddir@
SLAPD = @SLAPD@
-POPTOBJ = @POPTOBJ@
EXTRA_OBJ=@EXTRA_OBJ@
TESTS=test-tdb.sh @TESTS@
@@ -22,6 +21,9 @@ CFLAGS=-I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
LIB_FLAGS=-Llib -lldb @LIBS@
+REPDIR=replace
+REPLACE_OBJ=$(REPDIR)/replace.o $(REPDIR)/timegm.o
+
TDBDIR=tdb
TDB_OBJ=$(TDBDIR)/common/tdb.o $(TDBDIR)/common/dump.o \
$(TDBDIR)/common/io.o $(TDBDIR)/common/lock.o \
@@ -49,7 +51,7 @@ MODULES_OBJ=$(MODDIR)/operational.o $(MODDIR)/schema.o $(MODDIR)/rdn_name.o \
$(MODDIR)/objectclass.o \
$(MODDIR)/paged_results.o $(MODDIR)/sort.o $(MODDIR)/asq.o
-OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TALLOC_OBJ) $(EXTRA_OBJ) $(POPTOBJ)
+OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TALLOC_OBJ) $(EXTRA_OBJ) $(REPLACE_OBJ)
LDB_LIB = lib/libldb.a
@@ -59,7 +61,7 @@ LIBS = $(LDB_LIB)( $(OBJS) )
EXAMPLES = examples/ldbreader examples/ldifreader
-DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
+DIRS = lib bin common replace ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
all: dirs $(OBJS) $(LIBS) $(BINS) $(EXAMPLES) manpages
@@ -106,7 +108,7 @@ examples/ldifreader: examples/ldifreader.o $(LIBS)
.SUFFIXES: .1 .1.xml .3 .3.xml .xml .html
manpages:
- $(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
+ @$(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
doxygen:
test -z "$(DOXYGEN)" || (cd $(srcdir) && "$(DOXYGEN)")
diff --git a/source4/lib/ldb/config.mk b/source4/lib/ldb/config.mk
index dfbf3db449..1f92cd5d62 100644
--- a/source4/lib/ldb/config.mk
+++ b/source4/lib/ldb/config.mk
@@ -140,6 +140,16 @@ PUBLIC_DEPENDENCIES = \
# End MODULE ldb_tdb
################################################
+################################################
+# Start MODULE ldb_replace
+[MODULE::ldb_replace]
+SUBSYSTEM = ldb
+OBJ_FILES = \
+ replace/timegm.o \
+ replace/replace.o
+# End MODULE ldb_replace
+################################################
+
./lib/ldb/common/ldb_modules.o: lib/ldb/common/ldb_modules.c Makefile
@echo Compiling $<
@$(CC) $(CFLAGS) $(PICFLAG) -DMODULESDIR=\"$(MODULESDIR)/ldb\" -DSHLIBEXT=\"$(SHLIBEXT)\" -c $< -o $@
@@ -166,7 +176,7 @@ OBJ_FILES = \
common/ldb_controls.o \
common/qsort.o
PUBLIC_DEPENDENCIES = \
- LIBREPLACE LIBTALLOC
+ LIBREPLACE LIBTALLOC
MANPAGE = man/ldb.3
PUBLIC_HEADERS = include/ldb.h include/ldb_errors.h
#
diff --git a/source4/lib/ldb/configure.in b/source4/lib/ldb/configure.in
index 1e8e6a28e5..0571fb68e1 100644
--- a/source4/lib/ldb/configure.in
+++ b/source4/lib/ldb/configure.in
@@ -40,24 +40,18 @@ AC_CONFIG_HEADER(include/config.h)
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_FUNCS(dlopen dlsym dlclose)
-AC_CHECK_TYPE(uint8_t, unsigned char)
-AC_CHECK_TYPE(int64_t, long long)
-AC_CHECK_TYPE(uint64_t, unsigned long long)
-
-AC_CHECK_TYPE(comparison_fn_t,
-[AC_DEFINE(HAVE_COMPARISON_FN_T, 1,[Whether or not we have comparison_fn_t])])
-
SHLIBEXT="so" # Should be set based on OS later on
AC_SUBST(SHLIBEXT)
AC_DEFINE_UNQUOTED(MODULESDIR, LIBDIR "/ldb" , [Modules directory] )
AC_SUBST(MODULESDIR)
-sinclude(popt.m4)
-
TESTS=""
EXTRA_OBJ=""
+sinclude(popt.m4)
+sinclude(replace/config.m4)
+
sinclude(ldap.m4)
if test x"$with_ldap_support" = x"yes"; then
LIBS="$LIBS -L/usr/lib -llber -lldap"
diff --git a/source4/lib/ldb/ldb_tdb/ldb_pack.c b/source4/lib/ldb/ldb_tdb/ldb_pack.c
index b2a004b99f..c6edf663ae 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_pack.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_pack.c
@@ -155,16 +155,6 @@ int ltdb_pack_data(struct ldb_module *module,
return 0;
}
-/* using this means we can compile standalone on broken systems like
- MacOSX 10.4 */
-static size_t ldb_strnlen(const char *s, size_t n)
-{
- int i;
- for (i=0; s[i] && i<n; i++)
- /* noop */ ;
- return i;
-}
-
/*
unpack a ldb message from a linear buffer in TDB_DATA
@@ -201,7 +191,7 @@ int ltdb_unpack_data(struct ldb_module *module,
break;
case LTDB_PACKING_FORMAT:
- len = ldb_strnlen((char *)p, remaining);
+ len = strnlen((char *)p, remaining);
if (len == remaining) {
errno = EIO;
goto failed;
@@ -244,7 +234,7 @@ int ltdb_unpack_data(struct ldb_module *module,
errno = EIO;
goto failed;
}
- len = ldb_strnlen((char *)p, remaining-6);
+ len = strnlen((char *)p, remaining-6);
if (len == remaining-6) {
errno = EIO;
goto failed;
diff --git a/source4/lib/ldb/popt.m4 b/source4/lib/ldb/popt.m4
index 7c7969fa9d..558bfc73b1 100644
--- a/source4/lib/ldb/popt.m4
+++ b/source4/lib/ldb/popt.m4
@@ -19,11 +19,10 @@ if test x"$POPTDIR" = x; then
AC_CHECK_HEADERS(popt.h)
AC_CHECK_LIB(popt, poptGetContext)
else
- POPTOBJ="findme.o popt.o poptconfig.o popthelp.o poptparse.o"
+ EXTRA_OBJ="$EXTRA_OBJ findme.o popt.o poptconfig.o popthelp.o poptparse.o"
CFLAGS="$CFLAGS -I$POPTDIR"
fi
AC_CHECK_HEADERS([float.h alloca.h])
AC_CHECK_FUNCS(strerror)
-AC_SUBST(POPTOBJ)
AC_SUBST(POPTDIR)