selftest: correcting empty attribute usage in requests master
authorAaron Haslett <aaronhaslett@catalyst.net.nz>
Thu, 28 Mar 2019 02:54:06 +0000 (15:54 +1300)
committerGarming Sam <garming@samba.org>
Mon, 6 May 2019 04:22:52 +0000 (04:22 +0000)
Many parts of Samba use an empty attribute list in requests expecting
all attributes to be returned in the response, which is incorrect.  This
patch corrects the instances found by current CI tests.  Static analysis
and debugging will need to be done before changing ildap to the correct
semantics.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/samba_tool/computer.py
python/samba/tests/samba_tool/group.py
python/samba/tests/samba_tool/ou.py
python/samba/tests/samba_tool/user.py
source4/dsdb/tests/python/sec_descriptor.py

index 38ea5f7..6b06d4f 100644 (file)
@@ -282,7 +282,7 @@ class ComputerCmdTestCase(SambaToolCmdTest):
                           self.samdb.domain_dn()))
         computerlist = self.samdb.search(base=self.samdb.domain_dn(),
                                          scope=ldb.SCOPE_SUBTREE,
-                                         expression=search_filter, attrs=[])
+                                         expression=search_filter)
         if computerlist:
             return computerlist[0]
         else:
index 9862251..e521c72 100644 (file)
@@ -243,8 +243,7 @@ class GroupCmdTestCase(SambaToolCmdTest):
                           self.samdb.domain_dn()))
         grouplist = self.samdb.search(base=self.samdb.domain_dn(),
                                       scope=ldb.SCOPE_SUBTREE,
-                                      expression=search_filter,
-                                      attrs=[])
+                                      expression=search_filter)
         if grouplist:
             return grouplist[0]
         else:
index d318fd3..39b0cad 100644 (file)
@@ -264,8 +264,7 @@ class OUCmdTestCase(SambaToolCmdTest):
                           self.samdb.domain_dn()))
         oulist = self.samdb.search(base=self.samdb.domain_dn(),
                                    scope=ldb.SCOPE_SUBTREE,
-                                   expression=search_filter,
-                                   attrs=[])
+                                   expression=search_filter)
         if oulist:
             return oulist[0]
         else:
index 1816b89..7ae8087 100644 (file)
@@ -592,7 +592,7 @@ sAMAccountName: %s
         search_filter = "(&(sAMAccountName=%s)(objectCategory=%s,%s))" % (ldb.binary_encode(name), "CN=Person,CN=Schema,CN=Configuration", self.samdb.domain_dn())
         userlist = self.samdb.search(base=self.samdb.domain_dn(),
                                      scope=ldb.SCOPE_SUBTREE,
-                                     expression=search_filter, attrs=[])
+                                     expression=search_filter)
         if userlist:
             return userlist[0]
         else:
index 5e0f145..a495356 100755 (executable)
@@ -1847,7 +1847,7 @@ class SdFlagsDescriptorTests(DescriptorTests):
         self.assertFalse("nTSecurityDescriptor" in res[0])
 
         res = self.ldb_admin.search(self.base_dn, SCOPE_BASE, None,
-                                    [], controls=["sd_flags:1:%d" % (sd_flags)])
+                                    controls=["sd_flags:1:%d" % (sd_flags)])
         self.assertTrue("nTSecurityDescriptor" in res[0])
         tmp = res[0]["nTSecurityDescriptor"][0]
         sd = ndr_unpack(security.descriptor, tmp)