s4-dsdb: use dsdb_next_callback()
authorAndrew Tridgell <tridge@samba.org>
Tue, 5 Jan 2010 22:23:29 +0000 (09:23 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 8 Jan 2010 02:02:59 +0000 (13:02 +1100)
We can't just use the callers callback directly otherwise the
ldb_module_done() is never called on the parent request, as the child
request is passed to the callback.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/lazy_commit.c
source4/dsdb/samdb/ldb_modules/show_deleted.c

index b17f40e82a97b0c0c020634b0b69c293b227f899..0a297d587a9e13744e4f093d22e6c24072ebd382 100644 (file)
@@ -36,6 +36,7 @@
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "dsdb/samdb/samdb.h"
 #include "../libds/common/flags.h"
+#include "dsdb/samdb/ldb_modules/util.h"
 
 struct it_context {
        struct ldb_module *module;
@@ -143,7 +144,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
        ret = ldb_build_add_req(&down_req, ldb, req,
                                msg,
                                req->controls,
-                               req->context, req->callback,
+                               req, dsdb_next_callback,
                                req);
        if (ret != LDB_SUCCESS) {
                return ret;
index 0502b2efa14573cdb778677c85adad57deb9f7d3..b4eaf50d5152e56796dd0e7de81c949c897a62df 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include "ldb_module.h"
+#include "dsdb/samdb/ldb_modules/util.h"
 
 static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
 {
@@ -47,28 +48,28 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
                                              req->op.search.tree,
                                              req->op.search.attrs,
                                              req->controls,
-                                             req->context, req->callback,
+                                             req, dsdb_next_callback,
                                              req);
                break;
        case LDB_ADD:
                ret = ldb_build_add_req(&new_req, ldb_module_get_ctx(module), req,
                                        req->op.add.message,
                                        req->controls,
-                                       req->context, req->callback,
+                                       req, dsdb_next_callback,
                                        req);
                break;
        case LDB_MODIFY:
                ret = ldb_build_mod_req(&new_req, ldb_module_get_ctx(module), req,
                                        req->op.mod.message,
                                        req->controls,
-                                       req->context, req->callback,
+                                       req, dsdb_next_callback,
                                        req);
                break;
        case LDB_DELETE:
                ret = ldb_build_del_req(&new_req, ldb_module_get_ctx(module), req,
                                        req->op.del.dn,
                                        req->controls,
-                                       req->context, req->callback,
+                                       req, dsdb_next_callback,
                                        req);
                break;
        case LDB_RENAME:
@@ -76,7 +77,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
                                           req->op.rename.olddn,
                                           req->op.rename.newdn,
                                           req->controls,
-                                          req->context, req->callback,
+                                          req, dsdb_next_callback,
                                           req);
                break;
        case LDB_EXTENDED:
@@ -85,7 +86,7 @@ static int unlazy_op(struct ldb_module *module, struct ldb_request *req)
                                             req->op.extended.oid,
                                             req->op.extended.data,
                                             req->controls,
-                                            req->context, req->callback,
+                                            req, dsdb_next_callback,
                                             req);
                break;
        default:
index 666d28053c236fbfd35711c8e25bef61c9b73d65..93463ae95f95b5cd2da48ad322336197c11a79f9 100644 (file)
@@ -32,7 +32,7 @@
 #include "includes.h"
 #include "ldb/include/ldb_module.h"
 #include "dsdb/samdb/samdb.h"
-
+#include "dsdb/samdb/ldb_modules/util.h"
 
 static int show_deleted_search(struct ldb_module *module, struct ldb_request *req)
 {
@@ -83,7 +83,7 @@ static int show_deleted_search(struct ldb_module *module, struct ldb_request *re
                                      new_tree,
                                      req->op.search.attrs,
                                      req->controls,
-                                     req->context, req->callback,
+                                     req, dsdb_next_callback,
                                      req);
        if (ret != LDB_SUCCESS) {
                return ret;