diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-10-31 22:34:22 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-01 12:34:51 +0100 |
commit | 6f2001efa53fa3a46966bde8ed0e3307bbdcf0c4 (patch) | |
tree | 5e9bf19165a421b574db17930848df0959f3b7b9 | |
parent | 7da84bc7b6428b5b262f177b848c199d0fcd143a (diff) | |
download | samba-6f2001efa53fa3a46966bde8ed0e3307bbdcf0c4.tar.gz samba-6f2001efa53fa3a46966bde8ed0e3307bbdcf0c4.tar.bz2 samba-6f2001efa53fa3a46966bde8ed0e3307bbdcf0c4.zip |
s4:sam.py - test "objectSid" modification lockdown
-rwxr-xr-x | source4/dsdb/tests/python/sam.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/sam.py b/source4/dsdb/tests/python/sam.py index cb68ca9db0..1ac7b0dd14 100755 --- a/source4/dsdb/tests/python/sam.py +++ b/source4/dsdb/tests/python/sam.py @@ -646,6 +646,34 @@ class SamTests(unittest.TestCase): m = Message() m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn) + m["objectSid"] = MessageElement("xxxxxxxxxxxxxxxx", FLAG_MOD_ADD, + "objectSid") + try: + ldb.modify(m) + self.fail() + except LdbError, (num, _): + self.assertEquals(num, ERR_UNWILLING_TO_PERFORM) + + m = Message() + m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn) + m["objectSid"] = MessageElement([], FLAG_MOD_REPLACE, "objectSid") + try: + ldb.modify(m) + self.fail() + except LdbError, (num, _): + self.assertEquals(num, ERR_UNWILLING_TO_PERFORM) + + m = Message() + m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn) + m["objectSid"] = MessageElement([], FLAG_MOD_DELETE, "objectSid") + try: + ldb.modify(m) + self.fail() + except LdbError, (num, _): + self.assertEquals(num, ERR_UNWILLING_TO_PERFORM) + + m = Message() + m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn) m["sAMAccountType"] = MessageElement("0", FLAG_MOD_ADD, "sAMAccountType") try: |