From def9d268681625c2431e53d842f22a01af72c95c Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Tue, 4 Nov 2014 04:17:35 +0100 Subject: s4-dsdb: Mark request during Tombstone reanimation with custom LDAP control We are going to need this so that underlying modules (acl.c) can treat those requests properly Change-Id: I6c12069aa6e7e01197dddda6c610d930d3fd9cb0 Signed-off-by: Kamen Mazdrashki Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam --- source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c b/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c index 1f3bba8364..c175a0cbc4 100644 --- a/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c +++ b/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c @@ -144,6 +144,13 @@ static int _tr_do_rename(struct ldb_module *module, struct ldb_request *parent_r return ret; } + /* mark request as part of Tombstone reanimation */ + ret = ldb_request_add_control(req, DSDB_CONTROL_RESTORE_TOMBSTONE_OID, false, NULL); + if (ret != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return ret; + } + /* * Run request from the top module * so we get show_deleted control OID resolved @@ -187,6 +194,13 @@ static int _tr_do_modify(struct ldb_module *module, struct ldb_request *parent_r return ret; } + /* mark request as part of Tombstone reanimation */ + ret = ldb_request_add_control(mod_req, DSDB_CONTROL_RESTORE_TOMBSTONE_OID, false, NULL); + if (ret != LDB_SUCCESS) { + talloc_free(tmp_ctx); + return ret; + } + /* Run request from Next module */ ret = ldb_next_request(module, mod_req); if (ret == LDB_SUCCESS) { -- cgit