s4 samdb: pass ldb options to ldb_module_connect_backend
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 4 Jul 2019 02:22:29 +0000 (14:22 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 4 Jul 2019 10:02:23 +0000 (10:02 +0000)
Pass the ldb options into ldb_module_connect_backend, to ensure ldb
options such as "batch mode" and "transaction index cache size" get passed
through to the backend modules.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/partition_init.c

index 7d076932665df5d0e68c511ee6cbe740f9e2fbc0..19033b4f48fe2d28088775fef2d01c66f3876037 100644 (file)
@@ -207,6 +207,7 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
        struct ldb_module *backend_module;
        struct ldb_module *module_chain;
        const char **modules;
+       const char **options = NULL;
        int ret;
 
        (*partition) = talloc_zero(mem_ctx, struct dsdb_partition);
@@ -257,7 +258,9 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
        ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
        ctrl->dn = talloc_steal(ctrl, dn);
        
-       ret = ldb_module_connect_backend(ldb, (*partition)->backend_url, NULL, &backend_module);
+       options = ldb_options_get(ldb);
+       ret = ldb_module_connect_backend(
+           ldb, (*partition)->backend_url, options, &backend_module);
        if (ret != LDB_SUCCESS) {
                return ret;
        }