s4-dsdb: pass parent request to dsdb_module_*() functions
[samba.git] / source4 / dsdb / samdb / ldb_modules / samba_dsdb.c
index f07d03f9a792d5be5cc0dbbd7e220fd4b40cb0d1..bc5784e5acf28cdea95fcdd2b9357ca434df7df9 100644 (file)
@@ -39,7 +39,7 @@
 #include "librpc/ndr/libndr.h"
 
 static int read_at_rootdse_record(struct ldb_context *ldb, struct ldb_module *module, TALLOC_CTX *mem_ctx,
-                                 struct ldb_message **msg)
+                                 struct ldb_message **msg, struct ldb_request *parent)
 {
        int ret;
        static const char *rootdse_attrs[] = { "defaultNamingContext", "configurationNamingContext", "schemaNamingContext", NULL };
@@ -57,7 +57,7 @@ static int read_at_rootdse_record(struct ldb_context *ldb, struct ldb_module *mo
        }
 
        ret = dsdb_module_search_dn(module, tmp_ctx, &rootdse_res, rootdse_dn,
-                                   rootdse_attrs, DSDB_FLAG_NEXT_MODULE);
+                                   rootdse_attrs, DSDB_FLAG_NEXT_MODULE, parent);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -162,7 +162,6 @@ static int samba_dsdb_init(struct ldb_module *module)
        */
        static const char *modules_list[] = {"resolve_oids",
                                             "rootdse",
-                                            "aclread",
                                             "lazy_commit",
                                             "paged_results",
                                             "ranged_results",
@@ -174,6 +173,7 @@ static int samba_dsdb_init(struct ldb_module *module)
                                             "objectclass",
                                             "descriptor",
                                             "acl",
+                                            "aclread",
                                             "samldb",
                                             "password_hash",
                                             "operational",
@@ -218,6 +218,12 @@ static int samba_dsdb_init(struct ldb_module *module)
                return ldb_oom(ldb);
        }
 
+       ret = ldb_register_samba_handlers(ldb);
+       if (ret != LDB_SUCCESS) {
+               talloc_free(tmp_ctx);
+               return ret;
+       }
+
        samba_dsdb_dn = ldb_dn_new(tmp_ctx, ldb, "@SAMBA_DSDB");
        if (!samba_dsdb_dn) {
                talloc_free(tmp_ctx);
@@ -233,7 +239,7 @@ static int samba_dsdb_init(struct ldb_module *module)
        } while (0)
 
        ret = dsdb_module_search_dn(module, tmp_ctx, &res, samba_dsdb_dn,
-                                   samba_dsdb_attrs, DSDB_FLAG_NEXT_MODULE);
+                                   samba_dsdb_attrs, DSDB_FLAG_NEXT_MODULE, NULL);
        if (ret == LDB_ERR_NO_SUCH_OBJECT) {
                backendType = "ldb";
                serverRole = "domain controller";
@@ -288,7 +294,7 @@ static int samba_dsdb_init(struct ldb_module *module)
        CHECK_MODULE_LIST;
 
 
-       ret = read_at_rootdse_record(ldb, module, tmp_ctx, &rootdse_msg);
+       ret = read_at_rootdse_record(ldb, module, tmp_ctx, &rootdse_msg, NULL);
        CHECK_LDB_RET(ret);
 
        partition_msg = ldb_msg_new(tmp_ctx);