s4-dsdb: removed the use of ldb_private.h from s4
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 23:41:28 +0000 (10:41 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 2 Nov 2010 20:43:57 +0000 (07:43 +1100)
this will allow s4 to use a system version of ldb

source4/dsdb/samdb/ldb_modules/dsdb_cache.c [deleted file]
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/partition.h
source4/dsdb/samdb/ldb_modules/partition_init.c
source4/dsdb/samdb/ldb_modules/samba_dsdb.c
source4/dsdb/samdb/ldb_modules/samba_secrets.c
source4/dsdb/samdb/ldb_modules/schema.c
source4/dsdb/samdb/ldb_modules/util.c
source4/dsdb/samdb/ldb_modules/wscript_build
source4/lib/ldb-samba/samba_extensions.c

diff --git a/source4/dsdb/samdb/ldb_modules/dsdb_cache.c b/source4/dsdb/samdb/ldb_modules/dsdb_cache.c
deleted file mode 100644 (file)
index b252fff..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 
-   Unix SMB/CIFS mplementation.
-
-   The Module that loads some DSDB related things
-   into memory. E.g. it loads the dsdb_schema structure
-   
-   Copyright (C) Stefan Metzmacher 2007
-    
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-   
-*/
-
-#include "includes.h"
-#include "lib/ldb/include/ldb.h"
-#include "lib/ldb/include/ldb_errors.h"
-#include "lib/ldb/include/ldb_private.h"
-#include "dsdb/samdb/samdb.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-#include "librpc/gen_ndr/ndr_drsuapi.h"
-#include "librpc/gen_ndr/ndr_drsblobs.h"
-
-static int dsdb_cache_init(struct ldb_module *module)
-{
-       /* TODO: load the schema */
-       return ldb_next_init(module);
-}
-
-static const struct ldb_module_ops ldb_dsdb_cache_module_ops = {
-       .name           = "dsdb_cache",
-       .init_context   = dsdb_cache_init
-};
-
-int ldb_dsdb_cache_module_init(const char *version)
-{
-       LDB_MODULE_CHECK_VERSION(version);
-       return ldb_register_module(&ldb_dsdb_cache_module_ops);
-}
index 7732bcf07841dcca5e690fae38c9715aceae48f2..5163726b130025b566740191e3ac117a888cf201 100644 (file)
@@ -68,7 +68,7 @@ static struct partition_context *partition_init_ctx(struct ldb_module *module, s
  */
 int partition_request(struct ldb_module *module, struct ldb_request *request)
 {
-       if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) { \
+       if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) { \
                const struct dsdb_control_current_partition *partition = NULL;
                struct ldb_control *partition_ctrl = ldb_request_get_control(request, DSDB_CONTROL_CURRENT_PARTITION_OID);
                if (partition_ctrl) {
@@ -77,10 +77,10 @@ int partition_request(struct ldb_module *module, struct ldb_request *request)
                }
 
                if (partition != NULL) {
-                       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_request() -> %s", 
+                       ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_request() -> %s",
                                  ldb_dn_get_linearized(partition->dn));                        
                } else {
-                       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_request() -> (metadata partition)");                 
+                       ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_request() -> (metadata partition)");
                }
        }
 
@@ -138,7 +138,7 @@ static int partition_req_callback(struct ldb_request *req,
        struct ldb_control *partition_ctrl;
 
        ac = talloc_get_type(req->context, struct partition_context);
-       data = talloc_get_type(ac->module->private_data, struct partition_private_data);
+       data = talloc_get_type(ldb_module_get_private(ac->module), struct partition_private_data);
 
        if (!ares) {
                return ldb_module_done(ac->req, NULL, NULL,
@@ -369,7 +369,7 @@ static int partition_send_all(struct ldb_module *module,
                              struct ldb_request *req) 
 {
        unsigned int i;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
        int ret = partition_prep_request(ac, NULL);
        if (ret != LDB_SUCCESS) {
@@ -396,7 +396,7 @@ static int partition_replicate(struct ldb_module *module, struct ldb_request *re
        unsigned int i;
        int ret;
        struct dsdb_partition *partition;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
        if (!data || !data->partitions) {
                return ldb_next_request(module, req);
@@ -454,7 +454,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
 {
        struct ldb_control **saved_controls;
        /* Find backend */
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
        struct partition_context *ac;
        struct ldb_context *ldb;
@@ -677,7 +677,7 @@ static int partition_rename(struct ldb_module *module, struct ldb_request *req)
        /* Find backend */
        struct dsdb_partition *backend, *backend2;
        
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
 
        /* Skip the lot if 'data' isn't here yet (initialisation) */
@@ -711,13 +711,13 @@ static int partition_start_trans(struct ldb_module *module)
 {
        unsigned int i;
        int ret;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
        /* Look at base DN */
        /* Figure out which partition it is under */
        /* Skip the lot if 'data' isn't here yet (initialization) */
-       if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-               ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_start_trans() -> (metadata partition)");
+       if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+               ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_start_trans() -> (metadata partition)");
        }
        ret = ldb_next_start_trans(module);
        if (ret != LDB_SUCCESS) {
@@ -730,8 +730,8 @@ static int partition_start_trans(struct ldb_module *module)
        }
 
        for (i=0; data && data->partitions && data->partitions[i]; i++) {
-               if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-                       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_start_trans() -> %s", 
+               if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+                       ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_start_trans() -> %s",
                                  ldb_dn_get_linearized(data->partitions[i]->ctrl->dn));
                }
                ret = ldb_next_start_trans(data->partitions[i]->module);
@@ -754,27 +754,27 @@ static int partition_start_trans(struct ldb_module *module)
 static int partition_prepare_commit(struct ldb_module *module)
 {
        unsigned int i;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
 
        for (i=0; data && data->partitions && data->partitions[i]; i++) {
                int ret;
 
-               if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-                       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_prepare_commit() -> %s", 
+               if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+                       ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_prepare_commit() -> %s",
                                  ldb_dn_get_linearized(data->partitions[i]->ctrl->dn));
                }
                ret = ldb_next_prepare_commit(data->partitions[i]->module);
                if (ret != LDB_SUCCESS) {
-                       ldb_asprintf_errstring(module->ldb, "prepare_commit error on %s: %s",
+                       ldb_asprintf_errstring(ldb_module_get_ctx(module), "prepare_commit error on %s: %s",
                                               ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
-                                              ldb_errstring(module->ldb));
+                                              ldb_errstring(ldb_module_get_ctx(module)));
                        return ret;
                }
        }
 
-       if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-               ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_prepare_commit() -> (metadata partition)");
+       if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+               ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_prepare_commit() -> (metadata partition)");
        }
        return ldb_next_prepare_commit(module);
 }
@@ -785,7 +785,7 @@ static int partition_end_trans(struct ldb_module *module)
 {
        int ret, ret2;
        unsigned int i;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
 
        ret = LDB_SUCCESS;
@@ -798,21 +798,21 @@ static int partition_end_trans(struct ldb_module *module)
        }
 
        for (i=0; data && data->partitions && data->partitions[i]; i++) {
-               if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-                       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_end_trans() -> %s", 
+               if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+                       ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_end_trans() -> %s",
                                  ldb_dn_get_linearized(data->partitions[i]->ctrl->dn));
                }
                ret2 = ldb_next_end_trans(data->partitions[i]->module);
                if (ret2 != LDB_SUCCESS) {
-                       ldb_asprintf_errstring(module->ldb, "end_trans error on %s: %s",
+                       ldb_asprintf_errstring(ldb_module_get_ctx(module), "end_trans error on %s: %s",
                                               ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
-                                              ldb_errstring(module->ldb));
+                                              ldb_errstring(ldb_module_get_ctx(module)));
                        ret = ret2;
                }
        }
 
-       if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-               ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_end_trans() -> (metadata partition)");
+       if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+               ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_end_trans() -> (metadata partition)");
        }
        ret2 = ldb_next_end_trans(module);
        if (ret2 != LDB_SUCCESS) {
@@ -826,18 +826,18 @@ static int partition_del_trans(struct ldb_module *module)
 {
        int ret, final_ret = LDB_SUCCESS;
        unsigned int i;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
        for (i=0; data && data->partitions && data->partitions[i]; i++) {
-               if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-                       ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_del_trans() -> %s", 
+               if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+                       ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_del_trans() -> %s",
                                  ldb_dn_get_linearized(data->partitions[i]->ctrl->dn));
                }
                ret = ldb_next_del_trans(data->partitions[i]->module);
                if (ret != LDB_SUCCESS) {
-                       ldb_asprintf_errstring(module->ldb, "del_trans error on %s: %s",
+                       ldb_asprintf_errstring(ldb_module_get_ctx(module), "del_trans error on %s: %s",
                                               ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
-                                              ldb_errstring(module->ldb));
+                                              ldb_errstring(ldb_module_get_ctx(module)));
                        final_ret = ret;
                }
        }       
@@ -848,8 +848,8 @@ static int partition_del_trans(struct ldb_module *module)
        }
        data->in_transaction--;
 
-       if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
-               ldb_debug(module->ldb, LDB_DEBUG_TRACE, "partition_del_trans() -> (metadata partition)");
+       if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) {
+               ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_del_trans() -> (metadata partition)");
        }
        ret = ldb_next_del_trans(module);
        if (ret != LDB_SUCCESS) {
@@ -923,7 +923,7 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
        uint64_t seq_number = 0;
        uint64_t timestamp_sequence = 0;
        uint64_t timestamp = 0;
-       struct partition_private_data *data = talloc_get_type(module->private_data, 
+       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
                                                              struct partition_private_data);
        struct ldb_seqnum_request *seq;
        struct ldb_seqnum_result *seqr;
@@ -1164,7 +1164,7 @@ static int partition_extended(struct ldb_module *module, struct ldb_request *req
        struct partition_context *ac;
        int ret;
 
-       data = talloc_get_type(module->private_data, struct partition_private_data);
+       data = talloc_get_type(ldb_module_get_private(module), struct partition_private_data);
        if (!data) {
                return ldb_next_request(module, req);
        }
index 594634cc99032522d797dddca28aca42981c7b04..3b67d30217d531b494801c4577b388ac3dce0ec7 100644 (file)
@@ -21,7 +21,6 @@
 #include "lib/ldb/include/ldb.h"
 #include "lib/ldb/include/ldb_errors.h"
 #include "lib/ldb/include/ldb_module.h"
-#include "lib/ldb/include/ldb_private.h"
 #include "dsdb/samdb/samdb.h"
 #include "dsdb/samdb/ldb_modules/util.h"
 #include "system/locale.h"
index 7118fa0b3214c44dcc9be08fc3c94d186ffad2ef..eb67cd3e309381e1141a0a7d630718f0d6a89dd6 100644 (file)
@@ -32,6 +32,7 @@
 #include "dsdb/samdb/ldb_modules/partition.h"
 #include "lib/util/tsort.h"
 #include "lib/ldb-samba/ldb_wrap.h"
+#include "system/filesys.h"
 
 static int partition_sort_compare(const void *v1, const void *v2)
 {
@@ -232,7 +233,7 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
                }
                (*partition)->backend_url = talloc_steal((*partition), backend_url);
 
-               if (!(ldb->flags & LDB_FLG_RDONLY)) {
+               if (!(ldb_module_flags(ldb) & LDB_FLG_RDONLY)) {
                        char *p;
                        char *backend_dir = talloc_strdup(*partition, backend_url);
                        
@@ -251,7 +252,7 @@ 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_connect_backend(ldb, (*partition)->backend_url, NULL, &backend_module);
+       ret = ldb_module_connect_backend(ldb, (*partition)->backend_url, NULL, &backend_module);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -264,7 +265,7 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
                talloc_free(*partition);
                return LDB_ERR_CONSTRAINT_VIOLATION;
        }
-       ret = ldb_load_modules_list(ldb, modules, backend_module, &module_chain);
+       ret = ldb_module_load_list(ldb, modules, backend_module, &module_chain);
        if (ret != LDB_SUCCESS) {
                ldb_asprintf_errstring(ldb, 
                                       "partition_init: "
@@ -273,7 +274,7 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
                talloc_free(*partition);
                return ret;
        }
-       ret = ldb_init_module_chain(ldb, module_chain);
+       ret = ldb_module_init_chain(ldb, module_chain);
        if (ret != LDB_SUCCESS) {
                ldb_asprintf_errstring(ldb,
                                       "partition_init: "
@@ -289,13 +290,13 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva
                talloc_free(*partition);
                return ldb_oom(ldb);
        }
-       (*partition)->module->next = talloc_steal((*partition)->module, module_chain);
+       ldb_module_set_next((*partition)->module, talloc_steal((*partition)->module, module_chain));
 
        /* if we were in a transaction then we need to start a
           transaction on this new partition, otherwise we'll get a
           transaction mismatch when we end the transaction */
        if (data->in_transaction) {
-               if (ldb->flags & LDB_FLG_ENABLE_TRACING) {
+               if (ldb_module_flags(ldb) & LDB_FLG_ENABLE_TRACING) {
                        ldb_debug(ldb, LDB_DEBUG_TRACE, "partition_start_trans() -> %s (new partition)", 
                                  ldb_dn_get_linearized((*partition)->ctrl->dn));
                }
@@ -685,7 +686,7 @@ int partition_create(struct ldb_module *module, struct ldb_request *req)
        struct dsdb_create_partition_exop *ex_op = talloc_get_type(req->op.extended.data, struct dsdb_create_partition_exop);
        struct ldb_dn *dn = ex_op->new_dn;
 
-       data = talloc_get_type(module->private_data, struct partition_private_data);
+       data = talloc_get_type(ldb_module_get_private(module), struct partition_private_data);
        if (!data) {
                /* We are not going to create a partition before we are even set up */
                return LDB_ERR_UNWILLING_TO_PERFORM;
@@ -830,7 +831,7 @@ int partition_init(struct ldb_module *module)
                return ret;
        }
 
-       module->private_data = talloc_steal(module, data);
+       ldb_module_set_private(module, talloc_steal(module, data));
        talloc_free(mem_ctx);
 
        ret = ldb_mod_register_control(module, LDB_CONTROL_DOMAIN_SCOPE_OID);
index da2048766df5ede26ce9ebee35c507dad95294d8..f07d03f9a792d5be5cc0dbbd7e220fd4b40cb0d1 100644 (file)
@@ -34,8 +34,6 @@
 #include "lib/ldb/include/ldb.h"
 #include "lib/ldb/include/ldb_errors.h"
 #include "lib/ldb/include/ldb_module.h"
-#include "lib/ldb/include/ldb_private.h"
-
 #include "dsdb/samdb/ldb_modules/util.h"
 #include "dsdb/samdb/samdb.h"
 #include "librpc/ndr/libndr.h"
@@ -341,13 +339,13 @@ static int samba_dsdb_init(struct ldb_module *module)
        /* The backend (at least until the partitions module
         * reconfigures things) is the next module in the currently
         * loaded chain */
-       backend_module = module->next;
-       ret = ldb_load_modules_list(ldb, reverse_module_list, backend_module, &module_chain);
+       backend_module = ldb_module_next(module);
+       ret = ldb_module_load_list(ldb, reverse_module_list, backend_module, &module_chain);
        CHECK_LDB_RET(ret);
 
        talloc_free(tmp_ctx);
        /* Set this as the 'next' module, so that we effectivly append it to module chain */
-       module->next = module_chain;
+       ldb_module_set_next(module, module_chain);
 
        return ldb_next_init(module);
 }
index ae3b7fca27c1bad0ea0494b7518af0095338ab73..65ed23750633932ec9ceff6557d2457d262b20f9 100644 (file)
@@ -33,8 +33,6 @@
 #include "lib/ldb/include/ldb.h"
 #include "lib/ldb/include/ldb_errors.h"
 #include "lib/ldb/include/ldb_module.h"
-#include "lib/ldb/include/ldb_private.h"
-
 #include "dsdb/samdb/ldb_modules/util.h"
 #include "dsdb/samdb/samdb.h"
 
@@ -78,8 +76,8 @@ static int samba_secrets_init(struct ldb_module *module)
        /* The backend (at least until the partitions module
         * reconfigures things) is the next module in the currently
         * loaded chain */
-       backend_module = module->next;
-       ret = ldb_load_modules_list(ldb, reverse_module_list, backend_module, &module_chain);
+       backend_module = ldb_module_next(module);
+       ret = ldb_module_load_list(ldb, reverse_module_list, backend_module, &module_chain);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -87,7 +85,7 @@ static int samba_secrets_init(struct ldb_module *module)
 
        talloc_free(tmp_ctx);
        /* Set this as the 'next' module, so that we effectivly append it to module chain */
-       module->next = module_chain;
+       ldb_module_set_next(module, module_chain);
 
        return ldb_next_init(module);
 }
index 916017f97afc2181e6ca09b89f4ceee4efc96670..1a507fe1c9bb2f418d5199afdfcb4acbeead1a08 100644 (file)
@@ -27,7 +27,7 @@
 #include "dsdb/samdb/samdb.h"
 #include "util.h"
 #include "libcli/security/security.h"
-#include "lib/ldb/include/ldb_private.h"
+
 
 const struct dsdb_class * get_last_structural_class(const struct dsdb_schema *schema,const struct ldb_message_element *element)
 {
index 14fccb9658121d3d1c15bf13f8bdf4eb4b3a2651..e42bc7715e2049b47bc20b73ba8f6ec7d455316e 100644 (file)
@@ -27,7 +27,6 @@
 #include "dsdb/samdb/samdb.h"
 #include "util.h"
 #include "libcli/security/security.h"
-#include "lib/ldb/include/ldb_private.h"
 #include "libcli/security/session.h"
 
 /*
@@ -1105,10 +1104,7 @@ bool dsdb_block_anonymous_ops(struct ldb_module *module,
  */
 void dsdb_req_chain_debug(struct ldb_request *req, int level)
 {
-       int i=0;
-
-       while (req && req->handle) {
-               DEBUG(level,("req[%u] %p  : %s\n", i++, req, ldb_req_location(req)));
-               req = req->handle->parent;
-       }
+       char *s = ldb_module_call_chain(req, req);
+       DEBUG(level, ("%s\n", s));
+       talloc_free(s);
 }
index 4fe807fabc073c5ed92b286d8596a893e6589d78..1232465fbd92cb1d97728c90965d86a1dabb7a1c 100644 (file)
@@ -64,16 +64,6 @@ bld.SAMBA_MODULE('ldb_repl_meta_data',
        )
 
 
-bld.SAMBA_MODULE('ldb_dsdb_cache',
-       source='dsdb_cache.c',
-       subsystem='ldb',
-       init_function='ldb_dsdb_cache_module_init',
-        module_init_name='ldb_init_module',
-       internal_module=False,
-       deps='SAMDB talloc events'
-       )
-
-
 bld.SAMBA_MODULE('ldb_schema_load',
        source='schema_load.c',
        subsystem='ldb',
index 6eeac0b546fa0775d2902e39811910fa692d06d1..63b0f3df9197cb59d174d86957e907b10afb0298 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "includes.h"
 #include "ldb_module.h"
-#include "ldb_private.h"
 #include "lib/cmdline/popt_common.h"
 #include "auth/gensec/gensec.h"
 #include "auth/auth.h"
@@ -62,18 +61,19 @@ static int extensions_hook(struct ldb_context *ldb, enum ldb_module_hook_type t)
        switch (t) {
        case LDB_MODULE_HOOK_CMDLINE_OPTIONS: {
                unsigned len1, len2;
+               struct poptOption **popt_options = ldb_module_popt_options(ldb);
                struct poptOption *new_array;
 
-               len1 = calculate_popt_array_length(ldb->popt_options);
+               len1 = calculate_popt_array_length(*popt_options);
                len2 = calculate_popt_array_length(cmdline_extensions);
                new_array = talloc_array(NULL, struct poptOption, len1+len2+1);
                if (NULL == new_array) {
                        return ldb_oom(ldb);
                }
 
-               memcpy(new_array, ldb->popt_options, len1*sizeof(struct poptOption));
+               memcpy(new_array, *popt_options, len1*sizeof(struct poptOption));
                memcpy(new_array+len1, cmdline_extensions, (1+len2)*sizeof(struct poptOption));
-               ldb->popt_options = new_array;
+               (*popt_options) = new_array;
                return LDB_SUCCESS;
        }