summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c26
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/show_deleted.c2
4 files changed, 25 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn.c b/source4/dsdb/samdb/ldb_modules/extended_dn.c
index a571857bbb..6a7492013b 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn.c
@@ -215,7 +215,7 @@ static int extended_search(struct ldb_module *module, struct ldb_request *req)
int ret;
/* check if there's an extended dn control */
- control = get_control_from_list(req->controls, LDB_CONTROL_EXTENDED_DN_OID);
+ control = ldb_request_get_control(req, LDB_CONTROL_EXTENDED_DN_OID);
if (control == NULL) {
/* not found go on */
return ldb_next_request(module, req);
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index b23ceebf1b..bd037066ca 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -1,3 +1,4 @@
+
/*
Partitions ldb module
@@ -219,16 +220,26 @@ static int partition_send_request(struct partition_context *ac, struct dsdb_cont
ac->down_req = talloc_realloc(ac, ac->down_req,
struct ldb_request *, ac->num_requests + 1);
if (!ac->down_req) {
- ldb_set_errstring(ac->module->ldb, "Out of Memory");
+ ldb_oom(ac->module->ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
req = ac->down_req[ac->num_requests] = talloc(ac, struct ldb_request);
if (req == NULL) {
- ldb_set_errstring(ac->module->ldb, "Out of Memory");
+ ldb_oom(ac->module->ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
- *ac->down_req[ac->num_requests] = *ac->orig_req; /* copy the request */
+ *req = *ac->orig_req; /* copy the request */
+
+ if (ac->orig_req->controls) {
+ req->controls
+ = talloc_memdup(req,
+ ac->orig_req->controls, talloc_get_size(ac->orig_req->controls));
+ if (req->controls == NULL) {
+ ldb_oom(ac->module->ldb);
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ }
if (req->operation == LDB_SEARCH) {
/* If the search is for 'more' than this partition,
@@ -350,7 +361,14 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
/* (later) consider if we should be searching multiple
* partitions (for 'invisible' partition behaviour */
- if (ldb_get_opaque(module->ldb, "global_catalog")) {
+ struct ldb_control *search_control = ldb_request_get_control(req, LDB_CONTROL_SEARCH_OPTIONS_OID);
+
+ struct ldb_search_options_control *search_options = NULL;
+ if (search_control) {
+ search_options = talloc_get_type(search_control->data, struct ldb_search_options_control);
+ }
+
+ if (search_options && (search_options->search_options & LDB_SEARCH_OPTION_PHANTOM_ROOT)) {
int ret, i;
struct partition_context *ac;
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 51b6612236..10f3da243b 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -260,7 +260,7 @@ static int replmd_prepare_originating(struct ldb_module *module, struct ldb_requ
return LDB_ERR_CONSTRAINT_VIOLATION;
}
- partition_ctrl = get_control_from_list(req->controls, DSDB_CONTROL_CURRENT_PARTITION_OID);
+ partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
if (!partition_ctrl) {
ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
"%s: no current partition control found",
diff --git a/source4/dsdb/samdb/ldb_modules/show_deleted.c b/source4/dsdb/samdb/ldb_modules/show_deleted.c
index 9d624c9982..b94fe39c9a 100644
--- a/source4/dsdb/samdb/ldb_modules/show_deleted.c
+++ b/source4/dsdb/samdb/ldb_modules/show_deleted.c
@@ -96,7 +96,7 @@ static int show_deleted_search(struct ldb_module *module, struct ldb_request *re
int ret;
/* check if there's a show deleted control */
- control = get_control_from_list(req->controls, LDB_CONTROL_SHOW_DELETED_OID);
+ control = ldb_request_get_control(req, LDB_CONTROL_SHOW_DELETED_OID);
/* copy the request for modification */
down_req = talloc(req, struct ldb_request);