summaryrefslogtreecommitdiff
path: root/source4/torture/drs
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2017-08-14 15:31:08 +1200
committerAndrew Bartlett <abartlet@samba.org>2017-08-29 07:23:28 +0200
commit6158f1839fe42e9a5c9daacd3182f06527462fdf (patch)
treefff2ac263b384501e0dd0e46bc0f58f631db1c40 /source4/torture/drs
parent3c8fa7b27f29baf9c1c8309db2ac91816255c931 (diff)
downloadsamba-6158f1839fe42e9a5c9daacd3182f06527462fdf.tar.gz
selftest: GetNCChanges can 'accept' a repeated bad request
In theory, if we send the exact same rejected request again, we should get the same response back from the DC. However, we don't - the request is accepted if we send it a second time. This patch updates the repl_rodc test to demonstrate the problem (which now causes the test to fail). Note that although the bad GetNCChanges request is not rejected outright, the response that gets sent back is empty - it has no objects in it, so it's not an actual security hole. It is annoying problem for writing self-tests though. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/torture/drs')
-rw-r--r--source4/torture/drs/python/repl_rodc.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/torture/drs/python/repl_rodc.py b/source4/torture/drs/python/repl_rodc.py
index 01c9c6dbe83..ca3744c76ff 100644
--- a/source4/torture/drs/python/repl_rodc.py
+++ b/source4/torture/drs/python/repl_rodc.py
@@ -202,6 +202,13 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
except WERRORError as (enum, estr):
self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+ # send the same request again and we should get the same response
+ try:
+ (level, ctr) = self.rodc_drs.DsGetNCChanges(self.rodc_drs_handle, 10, req10)
+ self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
+ except WERRORError as (enum, estr):
+ self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+
# Retry with Administrator credentials, ignores password replication groups
(level, ctr) = self.drs.DsGetNCChanges(self.drs_handle, 10, req10)