mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s4:sam.py - test "objectSid" modification lockdown
This commit is contained in:
parent
7da84bc7b6
commit
6f2001efa5
@ -644,6 +644,34 @@ class SamTests(unittest.TestCase):
|
||||
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("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,
|
||||
|
Loading…
Reference in New Issue
Block a user