summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_search.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-29 23:46:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:43 -0500
commit0c7b82e5f6063de4114de21cf854ac67346e31f6 (patch)
treecc66c4f23e7029eae3be6edaf09d194d71016d47 /source4/lib/ldb/ldb_tdb/ldb_search.c
parent787d67c2cd780656cb5e6c0884c485f287b72c49 (diff)
downloadsamba-0c7b82e5f6063de4114de21cf854ac67346e31f6.tar.gz
samba-0c7b82e5f6063de4114de21cf854ac67346e31f6.tar.bz2
samba-0c7b82e5f6063de4114de21cf854ac67346e31f6.zip
r15942: Remove the sync internal ldb calls altogether.
This means that some modules have been disabled as well as they have not been ported to the async interface One of them is the ugly objectclass module. I hope that the change in samldb module will make the MMC happy without the need of this crappy module, we need proper handling in a decent schema module. proxy and ldb_map have also been disabled ldb_sqlite3 need to be ported as well (currenlty just broken). (This used to be commit 51083de795bdcbf649de926e86969adc20239b6d)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_search.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c95
1 files changed, 5 insertions, 90 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 9b45697098..529049e36b 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -470,51 +470,11 @@ static int ltdb_search_full(struct ldb_async_handle *handle)
return LDB_SUCCESS;
}
-static int ltdb_search_sync_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares)
-{
- struct ldb_result *res = NULL;
-
- if (!context) {
- ldb_set_errstring(ldb, talloc_strdup(ldb, "NULL Context in callback"));
- goto error;
- }
-
- res = *((struct ldb_result **)context);
-
- if (!res || !ares) {
- goto error;
- }
-
- if (ares->type == LDB_REPLY_ENTRY) {
- res->msgs = talloc_realloc(res, res->msgs, struct ldb_message *, res->count + 2);
- if (! res->msgs) {
- goto error;
- }
-
- res->msgs[res->count + 1] = NULL;
-
- res->msgs[res->count] = talloc_steal(res->msgs, ares->message);
- if (! res->msgs[res->count]) {
- goto error;
- }
-
- res->count++;
- } else {
- ldb_debug(ldb, LDB_DEBUG_ERROR, "unrecognized async reply in ltdb_search_sync_callback!\n");
- goto error;
- }
-
- talloc_free(ares);
- return LDB_SUCCESS;
-
-error:
- if (ares) talloc_free(ares);
- if (res) talloc_free(res);
- if (context) *((struct ldb_result **)context) = NULL;
- return LDB_ERR_OPERATIONS_ERROR;
-}
-
-int ltdb_search_async(struct ldb_module *module, struct ldb_request *req)
+/*
+ search the database with a LDAP-like expression.
+ choses a search method
+*/
+int ltdb_search(struct ldb_module *module, struct ldb_request *req)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
struct ltdb_async_context *ltdb_ac;
@@ -566,48 +526,3 @@ int ltdb_search_async(struct ldb_module *module, struct ldb_request *req)
return LDB_SUCCESS;
}
-/*
- search the database with a LDAP-like expression.
- choses a search method
-*/
-int ltdb_search_bytree(struct ldb_module *module, const struct ldb_dn *base,
- enum ldb_scope scope, struct ldb_parse_tree *tree,
- const char * const attrs[], struct ldb_result **res)
-{
- struct ldb_request *req;
- int ret;
-
- *res = talloc_zero(module, struct ldb_result);
- if (! *res) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- req = talloc_zero(module, struct ldb_request);
- if (! req) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- req->operation = LDB_ASYNC_SEARCH;
- req->op.search.base = base;
- req->op.search.scope = scope;
- req->op.search.tree = tree;
- req->op.search.attrs = attrs;
- req->controls = NULL;
- req->async.context = (void *)res;
- req->async.callback = ltdb_search_sync_callback;
-
- ret = ltdb_search_async(module, req);
-
- if (ret == LDB_SUCCESS) {
- ret = ldb_async_wait(req->async.handle, LDB_WAIT_ALL);
- talloc_free(req);
- }
-
- if (ret != LDB_SUCCESS) {
- talloc_free(*res);
- }
-
- return ret;
-}
-
-