diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-08-08 16:52:04 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-08-29 07:23:28 +0200 |
commit | 87bc8d8f16eca0a0e335a649106a80656b083a7d (patch) | |
tree | 74f736771447c7843843b9ff35402aba9194cb3a /source4/torture/drs | |
parent | cdb8c4ae80a05852a50e0b383c9696799fb21293 (diff) | |
download | samba-87bc8d8f16eca0a0e335a649106a80656b083a7d.tar.gz |
selftest: Confirm privileged replication of an OU is not permitted
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/torture/drs')
-rw-r--r-- | source4/torture/drs/python/getnc_exop.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/torture/drs/python/getnc_exop.py b/source4/torture/drs/python/getnc_exop.py index 2b4bdc4b714..37e5333e245 100644 --- a/source4/torture/drs/python/getnc_exop.py +++ b/source4/torture/drs/python/getnc_exop.py @@ -35,6 +35,7 @@ from drs_base import AbstractLink import samba.tests import random +from samba import werror, WERRORError import ldb from ldb import SCOPE_BASE @@ -193,6 +194,29 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): (level, ctr) = self.drs.DsGetNCChanges(self.drs_handle, 8, req8) self._check_ctr6(ctr, [ou2]) + def test_do_full_repl_on_ou(self): + """ + Make sure that a full replication on a not-an-nc fails with + the right error code + """ + + non_nc_ou = "OU=not-an-NC,%s" % self.ou + self.ldb_dc1.add({ + "dn": non_nc_ou, + "objectclass": "organizationalUnit" + }) + req8 = self._exop_req8(dest_dsa=None, + invocation_id=self.ldb_dc1.get_invocation_id(), + nc_dn_str=non_nc_ou, + exop=drsuapi.DRSUAPI_EXOP_NONE, + replica_flags=drsuapi.DRSUAPI_DRS_WRIT_REP) + + try: + (level, ctr) = self.drs.DsGetNCChanges(self.drs_handle, 8, req8) + self.fail("Expected DsGetNCChanges to fail with WERR_DS_CANT_FIND_EXPECTED_NC") + except WERRORError as (enum, estr): + self.assertEquals(enum, werror.WERR_DS_CANT_FIND_EXPECTED_NC) + def test_link_utdv_hwm(self): """Test verify the DRS_GET_ANC behavior.""" |