summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2019-12-06 18:26:42 +1300
committerKarolin Seeger <kseeger@samba.org>2020-01-10 11:56:20 +0100
commit7071888d5b556213be79545cac059a8b3f62baee (patch)
tree60d76c339ffe640b50e3dbe9bc2b797086891517
parent9e6b09e0fd52c664de7f0589074fef872c753fa2 (diff)
downloadsamba-7071888d5b556213be79545cac059a8b3f62baee.tar.gz
CVE-2019-14902 repl_meta_data: Set renamed = true (and so do SD inheritance) after any rename
Previously if there was a conflict, but the incoming object would still win, this was not marked as a rename, and so inheritence was not done. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12497 Signed-off-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--selftest/knownfail.d/repl_secdesc1
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c13
2 files changed, 13 insertions, 1 deletions
diff --git a/selftest/knownfail.d/repl_secdesc b/selftest/knownfail.d/repl_secdesc
index 13a9ce458dd..9dd632d99ed 100644
--- a/selftest/knownfail.d/repl_secdesc
+++ b/selftest/knownfail.d/repl_secdesc
@@ -1,2 +1 @@
-^samba4.drs.repl_secdesc.python\(.*\).repl_secdesc.ReplAclTestCase.test_acl_inheirt_renamed_object_in_conflict
^samba4.drs.repl_secdesc.python\(.*\).repl_secdesc.ReplAclTestCase.test_acl_inheirt_renamed_child_object
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 9812ded99fb..e67c3b0281e 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -6134,6 +6134,19 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
* replmd_replicated_apply_search_callback())
*/
ret = replmd_replicated_handle_rename(ar, msg, ar->req, &renamed);
+
+ /*
+ * This looks strange, but we must set this after any
+ * rename, otherwise the SD propegation will not
+ * happen (which might matter if we have a new parent)
+ *
+ * The additional case of calling
+ * replmd_op_name_modify_callback (below) is:
+ * - a no-op if there was no name change
+ * and
+ * - called in the default case regardless.
+ */
+ renamed = true;
}
if (ret != LDB_SUCCESS) {