summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2020-05-05 13:16:48 +1200
committerKarolin Seeger <kseeger@samba.org>2020-06-25 13:04:45 +0200
commit9d4b98d75ea6a283afc45e9e4aef91fdfb95a189 (patch)
tree15157940fc00b291e96020c72a4b4886ef39b048
parentc745a495415d77fd3ebfb8a658a1dad7cce114a5 (diff)
downloadsamba-9d4b98d75ea6a283afc45e9e4aef91fdfb95a189.tar.gz
CVE-2020-10730: selftest: Add test to confirm VLV interaction with ASQ
Tested against Windows 1709. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14364 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
-rw-r--r--source4/dsdb/tests/python/asq.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/asq.py b/source4/dsdb/tests/python/asq.py
index a32c9f40cd3..1c93a45f131 100644
--- a/source4/dsdb/tests/python/asq.py
+++ b/source4/dsdb/tests/python/asq.py
@@ -162,6 +162,33 @@ class ASQLDAPTest(samba.tests.TestCase):
self.assertIn(ldb.Dn(self.ldb, str(group)),
self.members)
+ def test_asq_vlv(self):
+ """Testing ASQ behaviour with VLV set.
+
+ ASQ is very strange, it turns a BASE search into a search for
+ all the objects pointed to by the specified attribute,
+ returning multiple entries!
+
+ """
+
+ sort_control = "server_sort:1:0:cn"
+
+ msgs = self.ldb.search(base=self.top_dn,
+ scope=ldb.SCOPE_BASE,
+ attrs=["objectGUID", "cn", "member"],
+ controls=["asq:1:member",
+ sort_control,
+ "vlv:1:20:20:11:0"])
+
+ self.assertEqual(len(msgs), 20)
+
+ for msg in msgs:
+ self.assertNotEqual(msg.dn, self.top_dn)
+ self.assertIn(msg.dn, self.members2)
+ for group in msg["member"]:
+ self.assertIn(ldb.Dn(self.ldb, str(group)),
+ self.members)
+
if "://" not in url:
if os.path.isfile(url):
url = "tdb://%s" % url