summaryrefslogtreecommitdiffstats
path: root/source4/dsdb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2014-11-27 06:20:33 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-02-03 05:02:12 +0100
commitdb993c0de4eeb391b68288b5d4909080dac23b26 (patch)
treea387a418911a7cce3ecd6077f766ad96802a1c55 /source4/dsdb
parentb4ccfbc214a52b2d8d3747614e445bccfac9a63b (diff)
downloadsamba-db993c0de4eeb391b68288b5d4909080dac23b26.tar.gz
samba-db993c0de4eeb391b68288b5d4909080dac23b26.tar.xz
samba-db993c0de4eeb391b68288b5d4909080dac23b26.zip
s4-dsdb/samldb: Don't allow rename requests on Deleted object
Windows behavior in case of renaming Deleted object is: * return ERR_NO_SUCH_OBJECT in case client is not providing SHOW_DELETED control * ERR_UNWILLING_TO_PERFORM otherwise Renaming of Deleted objects is allowed only through special Tombstone reanimation modify request Change-Id: I1eb33fc294a5de44917f6037988ea6362e6e21fc 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/samldb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index bf88168e14..8b23383bf4 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -3074,6 +3074,17 @@ static int check_rename_constraints(struct ldb_message *msg,
return LDB_SUCCESS;
}
+ if (ldb_msg_find_attr_as_bool(msg, "isDeleted", false)) {
+ /*
+ * check originating request if we are supposed
+ * to "see" this record in first place.
+ */
+ if (ldb_request_get_control(ac->req, LDB_CONTROL_SHOW_DELETED_OID) == NULL) {
+ return LDB_ERR_NO_SUCH_OBJECT;
+ }
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
+
/* Objects under CN=System */
dn1 = ldb_dn_copy(ac, ldb_get_default_basedn(ldb));