mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
s4:ldap.py - check if the "name" of an entry was really ignored
This commit is contained in:
@ -753,11 +753,17 @@ class BasicTests(unittest.TestCase):
|
|||||||
"objectclass": "group",
|
"objectclass": "group",
|
||||||
"name": "ldaptestgroupx"})
|
"name": "ldaptestgroupx"})
|
||||||
|
|
||||||
|
# proof if the name has been set correctly
|
||||||
|
res = ldb.search("cn=ldaptestgroup,cn=users," + self.base_dn,
|
||||||
|
scope=SCOPE_BASE, attrs=["name"])
|
||||||
|
self.assertTrue(len(res) == 1)
|
||||||
|
self.assertTrue("name" in res[0])
|
||||||
|
self.assertTrue(res[0]["name"][0] == "ldaptestgroup")
|
||||||
|
|
||||||
m = Message()
|
m = Message()
|
||||||
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
|
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
|
||||||
m["name"] = MessageElement("cn=ldaptestuser", FLAG_MOD_REPLACE,
|
m["name"] = MessageElement("cn=ldaptestuser", FLAG_MOD_REPLACE,
|
||||||
"name")
|
"name")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ldb.modify(m)
|
ldb.modify(m)
|
||||||
self.fail()
|
self.fail()
|
||||||
@ -768,7 +774,6 @@ class BasicTests(unittest.TestCase):
|
|||||||
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
|
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
|
||||||
m["cn"] = MessageElement("ldaptestuser",
|
m["cn"] = MessageElement("ldaptestuser",
|
||||||
FLAG_MOD_REPLACE, "cn")
|
FLAG_MOD_REPLACE, "cn")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ldb.modify(m)
|
ldb.modify(m)
|
||||||
self.fail()
|
self.fail()
|
||||||
|
Reference in New Issue
Block a user