summaryrefslogtreecommitdiffstats
path: root/source4/dsdb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2014-10-26 04:31:41 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-02-03 05:02:10 +0100
commitffdc834bd1433aa100ba57ae9e47fa09e591b8f7 (patch)
tree866b47149d65fbae8d6597ec87448c79aa556a44 /source4/dsdb
parentf84e1989b452738f8cb5c1930e50bd13499c9de6 (diff)
downloadsamba-ffdc834bd1433aa100ba57ae9e47fa09e591b8f7.tar.gz
samba-ffdc834bd1433aa100ba57ae9e47fa09e591b8f7.tar.xz
samba-ffdc834bd1433aa100ba57ae9e47fa09e591b8f7.zip
s4-dsdb: Return error codes as windows does for Tombstone reanimation
Tested against Windows Server 2008 R2 In case we try to restore to already existing object, windows returns: LDB_ERR_ENTRY_ALREADY_EXISTS Otherwise it is: LDB_ERR_OPERATIONS_ERROR Change-Id: I6b5fea1e327416ccf5069d97a4a378a527a25f80 Signed-off-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c b/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c
index 989a664e07..321f16b463 100644
--- a/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c
+++ b/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c
@@ -206,6 +206,10 @@ static int tombstone_reanimate_modify(struct ldb_module *module, struct ldb_requ
ret = dsdb_module_rename(module, req->op.mod.message->dn, dn_new, DSDB_FLAG_TOP_MODULE | DSDB_SEARCH_SHOW_DELETED, req);
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) {
+ /* Windows returns Operations Error in case we can't rename the object */
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
return ret;
}