summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_search.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-11-16 09:00:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:52 -0500
commit8a18778286a16423d7d6e483fdb308a91e294efe (patch)
treeb1cf6a44c1cb4deccb04897ab426a724204b3f52 /source4/lib/ldb/ldb_tdb/ldb_search.c
parente81157c7379116d83b9906e27c9fd418c779d129 (diff)
downloadsamba-8a18778286a16423d7d6e483fdb308a91e294efe.tar.gz
samba-8a18778286a16423d7d6e483fdb308a91e294efe.tar.bz2
samba-8a18778286a16423d7d6e483fdb308a91e294efe.zip
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)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_search.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c40
1 files changed, 7 insertions, 33 deletions
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"
@@ -56,34 +58,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
*/
static int msg_add_element(struct ldb_context *ldb,
@@ -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;
}