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 | 844b736a1dd05159850ccc28eee1b3e625489139 (patch) | |
tree | 1379573cf66132cf41f74395c1e372759bdcbec8 | |
parent | a882b41d44b20476a0b1549260e07be3398f9752 (diff) | |
download | samba-844b736a1dd05159850ccc28eee1b3e625489139.tar.gz samba-844b736a1dd05159850ccc28eee1b3e625489139.tar.bz2 samba-844b736a1dd05159850ccc28eee1b3e625489139.zip |
s4:dsdb/objectclass: 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/objectclass.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index 074360086f..590927a7aa 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -351,6 +351,13 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req) return ret; } + ret = dsdb_request_add_controls(search_req, + DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED); + if (ret != LDB_SUCCESS) { + return ret; + } + ac->step_fn = objectclass_do_add; return ldb_next_request(ac->module, search_req); @@ -797,6 +804,13 @@ static int oc_modify_callback(struct ldb_request *req, struct ldb_reply *ares) return ldb_module_done(ac->req, NULL, NULL, ret); } + ret = dsdb_request_add_controls(search_req, + DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED); + if (ret != LDB_SUCCESS) { + return ldb_module_done(ac->req, NULL, NULL, ret); + } + ac->step_fn = objectclass_do_mod; ret = ldb_next_request(ac->module, search_req); @@ -1021,9 +1035,9 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req /* we have to add the show recycled control, as otherwise DRS deletes will be refused as we will think the target parent does not exist */ - ret = ldb_request_add_control(search_req, LDB_CONTROL_SHOW_RECYCLED_OID, - false, NULL); - + ret = dsdb_request_add_controls(search_req, + DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED); if (ret != LDB_SUCCESS) { return ret; } @@ -1071,6 +1085,13 @@ static int objectclass_do_rename(struct oc_context *ac) return ret; } + ret = dsdb_request_add_controls(search_req, + DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED); + if (ret != LDB_SUCCESS) { + return ret; + } + ac->step_fn = objectclass_do_rename2; return ldb_next_request(ac->module, search_req); @@ -1251,6 +1272,13 @@ static int objectclass_delete(struct ldb_module *module, struct ldb_request *req return ret; } + ret = dsdb_request_add_controls(search_req, + DSDB_FLAG_AS_SYSTEM | + DSDB_SEARCH_SHOW_RECYCLED); + if (ret != LDB_SUCCESS) { + return ret; + } + ac->step_fn = objectclass_do_delete; return ldb_next_request(ac->module, search_req); |