diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-11-19 06:59:33 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-11-30 17:17:19 +0100 |
commit | 659277a89dfd4226db9ea44709010ad7e3768fd6 (patch) | |
tree | 09c4bae82829845985b1caf7205c3de13b90172f | |
parent | 844b736a1dd05159850ccc28eee1b3e625489139 (diff) | |
download | samba-659277a89dfd4226db9ea44709010ad7e3768fd6.tar.gz samba-659277a89dfd4226db9ea44709010ad7e3768fd6.tar.bz2 samba-659277a89dfd4226db9ea44709010ad7e3768fd6.zip |
s4:dsdb/extended_dn_in: do helper searches AS_SYSTEM and with SHOW_RECYCLED
Note that SHOW_RECYCLED implies SHOW_DELETED.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/extended_dn_in.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c index c21a1ea69b..034d22a2ca 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c @@ -412,7 +412,8 @@ static int extended_dn_filter_callback(struct ldb_parse_tree *tree, void *privat } dsdb_flags = DSDB_FLAG_NEXT_MODULE | - DSDB_SEARCH_SHOW_DELETED | + DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED | DSDB_SEARCH_SHOW_EXTENDED_DN; if (guid_val) { @@ -555,6 +556,7 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req } else { /* It looks like we need to map the DN */ const struct ldb_val *sid_val, *guid_val, *wkguid_val; + uint32_t dsdb_flags = 0; if (!ldb_dn_match_allowed(dn, req)) { return ldb_error(ldb_module_get_ctx(module), @@ -651,7 +653,7 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req base_dn_scope, base_dn_filter, base_dn_attrs, - req->controls, + NULL, ac, extended_base_callback, req); LDB_REQ_SET_LOCATION(down_req); @@ -659,17 +661,16 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req return ldb_operr(ldb_module_get_ctx(module)); } + dsdb_flags = DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED | + DSDB_SEARCH_SHOW_EXTENDED_DN; if (all_partitions) { - struct ldb_search_options_control *control; - control = talloc(down_req, struct ldb_search_options_control); - control->search_options = 2; - ret = ldb_request_replace_control(down_req, - LDB_CONTROL_SEARCH_OPTIONS_OID, - true, control); - if (ret != LDB_SUCCESS) { - ldb_oom(ldb_module_get_ctx(module)); - return ret; - } + dsdb_flags |= DSDB_SEARCH_SEARCH_ALL_PARTITIONS; + } + + ret = dsdb_request_add_controls(down_req, dsdb_flags); + if (ret != LDB_SUCCESS) { + return ret; } /* perform the search */ |