Skip to content

Commit

Permalink
s4-dsdb: Some minor fixes in tombstone_reanimate, to make it work wit…
Browse files Browse the repository at this point in the history
…h acl

Change-Id: Idad221c7ecf778fd24f6017bb4c6eacac541086a
Signed-off-by: Nadezhda Ivanova <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Garming Sam <[email protected]>
  • Loading branch information
nivanova-symas authored and abartlet committed Feb 3, 2015
1 parent d633492 commit 2aa2e9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int _tr_do_rename(struct ldb_module *module, struct ldb_request *parent_r
return ret;
}

ret = dsdb_request_add_controls(req, DSDB_SEARCH_SHOW_DELETED);
ret = ldb_request_add_control(req, LDB_CONTROL_SHOW_DELETED_OID, false, NULL);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
Expand All @@ -155,7 +155,7 @@ static int _tr_do_rename(struct ldb_module *module, struct ldb_request *parent_r
* Run request from the top module
* so we get show_deleted control OID resolved
*/
ret = ldb_request(ldb_module_get_ctx(module), req);
ret = ldb_next_request(module, req);
if (ret == LDB_SUCCESS) {
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
}
Expand Down Expand Up @@ -263,7 +263,7 @@ static int tombstone_reanimate_modify(struct ldb_module *module, struct ldb_requ
ret = _tr_do_rename(module, req, req->op.mod.message->dn, dn_new);
if (ret != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "Renaming object to %s has failed with %s\n", el_dn->values[0].data, ldb_strerror(ret));
if (ret != LDB_ERR_ENTRY_ALREADY_EXISTS) {
if (ret != LDB_ERR_ENTRY_ALREADY_EXISTS && ret != LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS ) {
/* Windows returns Operations Error in case we can't rename the object */
return LDB_ERR_OPERATIONS_ERROR;
}
Expand Down Expand Up @@ -298,7 +298,7 @@ static int tombstone_reanimate_modify(struct ldb_module *module, struct ldb_requ
}
ret = _tr_do_modify(module, req, msg);
if (ret != LDB_SUCCESS) {
return ldb_operr(ldb);
return ret;
}

return ldb_module_done(ac->req, NULL, NULL, LDB_SUCCESS);
Expand Down

0 comments on commit 2aa2e9a

Please sign in to comment.