summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-15 16:36:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:13 -0500
commit132b046ec833072bb29fc01aa6e063eee63090da (patch)
tree68226a7d0aa421aa3deed325439a652c0f4b903e
parentc046f2e7a35e2cef2c1482f7d6a3f16be45b49d4 (diff)
downloadsamba-132b046ec833072bb29fc01aa6e063eee63090da.tar.gz
samba-132b046ec833072bb29fc01aa6e063eee63090da.tar.bz2
samba-132b046ec833072bb29fc01aa6e063eee63090da.zip
r19721: ldapsrv_SearchCallback isn't needed any more
ldb_search_default_callback does the same... metze (This used to be commit 0edac60ec6f1e67de8e08f4e71e56b674915ad6e)
-rw-r--r--source4/ldap_server/ldap_backend.c61
1 files changed, 1 insertions, 60 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index 8e102139fe..05b263204e 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -143,65 +143,6 @@ NTSTATUS ldapsrv_unwilling(struct ldapsrv_call *call, int error)
return NT_STATUS_OK;
}
-static int ldapsrv_SearchCallback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
-{
- struct ldb_result *res;
- int n;
-
- if (!context || !ares) {
- DEBUG(3, ("NULL Context or Ares in ldapsrv_SearchCallback"));
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- res = talloc_get_type(context, struct ldb_result);
-
- 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++;
- }
-
- if (ares->type == LDB_REPLY_REFERRAL) {
- if (res->refs) {
- for (n = 0; res->refs[n]; n++) /*noop*/ ;
- } else {
- n = 0;
- }
-
- res->refs = talloc_realloc(res, res->refs, char *, n + 2);
- if (! res->refs) {
- goto error;
- }
-
- res->refs[n] = talloc_steal(res->refs, ares->referral);
- res->refs[n + 1] = NULL;
- }
-
- if (ares->controls) {
- res->controls = talloc_steal(res, ares->controls);
- if (! res->controls) {
- goto error;
- }
- }
-
- talloc_free(ares);
- return LDB_SUCCESS;
-
-error:
- talloc_free(ares);
- return LDB_ERR_OPERATIONS_ERROR;
-}
-
static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
{
struct ldap_SearchRequest *req = &call->request->r.SearchRequest;
@@ -285,7 +226,7 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
lreq->controls = call->request->controls;
lreq->context = res;
- lreq->callback = ldapsrv_SearchCallback;
+ lreq->callback = ldb_search_default_callback;
/* Copy the timeout from the incoming call */
ldb_set_timeout(samdb, lreq, req->timelimit);