summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-03-09 13:53:41 +0200
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-03-09 13:53:41 +0200
commit4b8961bc6f7aaf2c420d7b2bc2ef6eb07ab42429 (patch)
tree95b3dd2d386de9009aa20a984cfa39931fd706dc /source4/lib/ldb
parentf742623b7b8a19ff3230754562deeac7657cd8cd (diff)
downloadsamba-4b8961bc6f7aaf2c420d7b2bc2ef6eb07ab42429.tar.gz
samba-4b8961bc6f7aaf2c420d7b2bc2ef6eb07ab42429.tar.bz2
samba-4b8961bc6f7aaf2c420d7b2bc2ef6eb07ab42429.zip
Fixed a bug in acl tests - python error when we create user/group/ou with a descriptor.
Diffstat (limited to 'source4/lib/ldb')
-rwxr-xr-xsource4/lib/ldb/tests/python/acl.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/source4/lib/ldb/tests/python/acl.py b/source4/lib/ldb/tests/python/acl.py
index 42c8c7efda..06136894e7 100755
--- a/source4/lib/ldb/tests/python/acl.py
+++ b/source4/lib/ldb/tests/python/acl.py
@@ -120,51 +120,51 @@ member: """ + member_dn
_ldb.modify_ldif(ldif)
def create_ou(self, _ldb, ou_dn, desc=None):
- ou_dict = {
- "dn" : ou_dn,
- "ou" : ou_dn.split(",")[0][3:],
- "objectClass" : "organizationalUnit",
- "url" : "www.bbc.co.uk",
- }
+ ldif = """
+dn: """ + ou_dn + """
+ou: """ + ou_dn.split(",")[0][3:] + """
+objectClass: organizationalUnit
+url: www.example.com
+"""
if desc:
assert(isinstance(desc, str) or isinstance(desc, security.descriptor))
if isinstance(desc, str):
ldif += "nTSecurityDescriptor: %s" % desc
elif isinstance(desc, security.descriptor):
ldif += "nTSecurityDescriptor:: %s" % base64.b64encode(ndr_pack(desc))
- _ldb.add(ou_dict)
+ _ldb.add_ldif(ldif)
def create_user(self, _ldb, user_dn, desc=None):
- user_dict = {
- "dn" : user_dn,
- "sAMAccountName" : user_dn.split(",")[0][3:],
- "objectClass" : "user",
- "userPassword" : self.user_pass,
- "url" : "www.bbc.co.uk",
- }
+ ldif = """
+dn: """ + user_dn + """
+sAMAccountName: """ + user_dn.split(",")[0][3:] + """
+objectClass: user
+userPassword: """ + self.user_pass + """
+url: www.example.com
+"""
if desc:
assert(isinstance(desc, str) or isinstance(desc, security.descriptor))
if isinstance(desc, str):
ldif += "nTSecurityDescriptor: %s" % desc
elif isinstance(desc, security.descriptor):
ldif += "nTSecurityDescriptor:: %s" % base64.b64encode(ndr_pack(desc))
- _ldb.add(user_dict)
+ _ldb.add_ldif(ldif)
def create_group(self, _ldb, group_dn, desc=None):
- group_dict = {
- "dn" : group_dn,
- "objectClass" : "group",
- "sAMAccountName" : group_dn.split(",")[0][3:],
- "groupType" : "4",
- "url" : "www.bbc.co.uk",
- }
+ ldif = """
+dn: """ + group_dn + """
+objectClass: group
+sAMAccountName: """ + group_dn.split(",")[0][3:] + """
+groupType: 4
+url: www.example.com
+"""
if desc:
assert(isinstance(desc, str) or isinstance(desc, security.descriptor))
if isinstance(desc, str):
ldif += "nTSecurityDescriptor: %s" % desc
elif isinstance(desc, security.descriptor):
ldif += "nTSecurityDescriptor:: %s" % base64.b64encode(ndr_pack(desc))
- _ldb.add(group_dict)
+ _ldb.add_ldif(ldif)
def read_desc(self, object_dn):
res = self.ldb_admin.search(object_dn, SCOPE_BASE, None, ["nTSecurityDescriptor"])