From 8a18778286a16423d7d6e483fdb308a91e294efe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 16 Nov 2004 09:00:52 +0000 Subject: r3783: - don't use make proto for ldb anymore - split ldh.h out of samba's includes.h - make ldb_context and ldb_module private to the subsystem - use ltdb_ prefix for all ldb_tdb functions metze (This used to be commit f5ee40d6ce8224e280070975efc9911558fe675c) --- source4/lib/ldb/ldb_tdb/ldb_search.c | 40 +++++++----------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) (limited to 'source4/lib/ldb/ldb_tdb/ldb_search.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index cb93483881..903c4cb802 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -33,6 +33,8 @@ */ #include "includes.h" +#include "ldb/include/ldb.h" +#include "ldb/include/ldb_private.h" #include "ldb/ldb_tdb/ldb_tdb.h" #include "ldb/include/ldb_parse.h" @@ -55,34 +57,6 @@ static void msg_free_all_parts(struct ldb_context *ldb, struct ldb_message *msg) } -/* - duplicate a ldb_val structure -*/ -struct ldb_val ldb_val_dup(struct ldb_context *ldb, - const struct ldb_val *v) -{ - struct ldb_val v2; - v2.length = v->length; - if (v->length == 0) { - v2.data = NULL; - return v2; - } - - /* the +1 is to cope with buggy C library routines like strndup - that look one byte beyond */ - v2.data = ldb_malloc(ldb, v->length+1); - if (!v2.data) { - v2.length = 0; - return v2; - } - - memcpy(v2.data, v->data, v->length); - ((char *)v2.data)[v->length] = 0; - return v2; -} - - - /* add one element to a message */ @@ -319,7 +293,7 @@ int ltdb_search_dn1(struct ldb_module *module, const char *dn, struct ldb_messag msg->num_elements = 0; msg->elements = NULL; - ret = ltdb_unpack_data(ldb, &tdb_data2, msg); + ret = ltdb_unpack_data(module, &tdb_data2, msg); if (ret == -1) { ldb_free(ldb, tdb_data2.dptr); return -1; @@ -439,7 +413,7 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi } /* unpack the record */ - ret = ltdb_unpack_data(sinfo->module->ldb, &data, &msg); + ret = ltdb_unpack_data(sinfo->module, &data, &msg); if (ret == -1) { sinfo->failures++; return 0; @@ -450,9 +424,9 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi } /* see if it matches the given expression */ - if (!ldb_message_match(sinfo->module, &msg, sinfo->tree, + if (!ltdb_message_match(sinfo->module, &msg, sinfo->tree, sinfo->base, sinfo->scope)) { - ltdb_unpack_data_free(sinfo->module->ldb, &msg); + ltdb_unpack_data_free(sinfo->module, &msg); return 0; } @@ -462,7 +436,7 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi sinfo->failures++; } - ltdb_unpack_data_free(sinfo->module->ldb, &msg); + ltdb_unpack_data_free(sinfo->module, &msg); return ret; } -- cgit