diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-02-20 20:31:41 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-02-21 21:44:24 +0100 |
commit | c16d4fb76d3a0c9c0f51790e3f448d6083f0f836 (patch) | |
tree | 3eaf2b4f8ceb1637c4dfc18d4a7bafdff7eb79a5 | |
parent | 461987bc26c89253f5ee71e3c374d4b0db79c84b (diff) | |
download | samba-c16d4fb76d3a0c9c0f51790e3f448d6083f0f836.tar.gz samba-c16d4fb76d3a0c9c0f51790e3f448d6083f0f836.tar.bz2 samba-c16d4fb76d3a0c9c0f51790e3f448d6083f0f836.zip |
s4:partition DSDB module - Cosmetic fixups
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/partition.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 59e7fab393..9bd4578a7f 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -62,9 +62,8 @@ static struct partition_context *partition_init_ctx(struct ldb_module *module, s } /* - * helper functions to call the next module in chain - * */ - + * helper functions to call the next module in chain + */ int partition_request(struct ldb_module *module, struct ldb_request *request) { if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) { \ @@ -150,13 +149,13 @@ static int partition_req_callback(struct ldb_request *req, * or this is an individual search result, we can * deterministily tell the caller what partition this was * written to (repl_meta_data likes to know) */ - ret = ldb_reply_add_control(ares, - DSDB_CONTROL_CURRENT_PARTITION_OID, - false, partition_ctrl->data); - if (ret != LDB_SUCCESS) { - return ldb_module_done(ac->req, NULL, NULL, - ret); - } + ret = ldb_reply_add_control(ares, + DSDB_CONTROL_CURRENT_PARTITION_OID, + false, partition_ctrl->data); + if (ret != LDB_SUCCESS) { + return ldb_module_done(ac->req, NULL, NULL, + ret); + } } if (ares->error != LDB_SUCCESS) { @@ -485,12 +484,14 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) } /* TODO: - Generate referrals (look for a partition under this DN) if we don't have the above control specified - */ + * Generate referrals (look for a partition under this DN) if we don't + * have the LDB_CONTROL_DOMAIN_SCOPE_OID control specified. + */ if (search_options && (search_options->search_options & LDB_SEARCH_OPTION_PHANTOM_ROOT)) { int i; struct partition_context *ac; + if ((search_options->search_options & ~LDB_SEARCH_OPTION_PHANTOM_ROOT) == 0) { /* We have processed this flag, so we are done with this control now */ @@ -500,6 +501,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) return LDB_ERR_OPERATIONS_ERROR; } } + ac = partition_init_ctx(module, req); if (!ac) { return LDB_ERR_OPERATIONS_ERROR; @@ -553,7 +555,6 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) /* fire the first one */ return partition_call_first(ac); - } else { /* Handle this like all other requests */ if (search_control && (search_options->search_options & ~LDB_SEARCH_OPTION_PHANTOM_ROOT) == 0) { @@ -682,7 +683,9 @@ static int partition_prepare_commit(struct ldb_module *module) } 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_dn_get_linearized(data->partitions[i]->ctrl->dn), ldb_errstring(module->ldb)); + ldb_asprintf_errstring(module->ldb, "prepare_commit error on %s: %s", + ldb_dn_get_linearized(data->partitions[i]->ctrl->dn), + ldb_errstring(module->ldb)); return ret; } } @@ -717,7 +720,9 @@ static int partition_end_trans(struct ldb_module *module) } 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_dn_get_linearized(data->partitions[i]->ctrl->dn), ldb_errstring(module->ldb)); + ldb_asprintf_errstring(module->ldb, "end_trans error on %s: %s", + ldb_dn_get_linearized(data->partitions[i]->ctrl->dn), + ldb_errstring(module->ldb)); ret = ret2; } } @@ -745,7 +750,9 @@ static int partition_del_trans(struct ldb_module *module) } 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_dn_get_linearized(data->partitions[i]->ctrl->dn), ldb_errstring(module->ldb)); + ldb_asprintf_errstring(module->ldb, "del_trans error on %s: %s", + ldb_dn_get_linearized(data->partitions[i]->ctrl->dn), + ldb_errstring(module->ldb)); final_ret = ret; } } |