summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2020-05-14 10:21:19 +1200
committerAndrew Bartlett <abartlet@samba.org>2020-05-15 06:05:30 +0000
commit87bf1d687fe7b48a7b6d511dfc7f5414db16119c (patch)
treeb5fb4853c732e179acd325a4aa089c53193c5004 /python
parent4e08ea2aa3ed95398c9679aaaa2722aecff77547 (diff)
downloadsamba-87bf1d687fe7b48a7b6d511dfc7f5414db16119c.tar.gz
librpc/idl: Add dnsp_DnsProperty_short
This will be used by a test and the DNS server code to parse short dnsProperty records which come from Windows servers. This example is from the value that caused Samba to fail as it can not be parsed as a normal dnsp_DnsProperty BUG: https://bugzilla.samba.org/show_bug.cgi?id=14310 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/blackbox/ndrdump.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/python/samba/tests/blackbox/ndrdump.py b/python/samba/tests/blackbox/ndrdump.py
index 0b72684f270..a33229e4740 100644
--- a/python/samba/tests/blackbox/ndrdump.py
+++ b/python/samba/tests/blackbox/ndrdump.py
@@ -468,3 +468,24 @@ dump OK
# check_output will return bytes
# convert expected to bytes for python 3
self.assertRegex(actual.decode('utf8'), expected + '$')
+
+ def test_ndrdump_short_dnsProperty(self):
+ expected = b'''pull returned Success
+ dnsp_DnsProperty_short: struct dnsp_DnsProperty_short
+ wDataLength : 0x00000000 (0)
+ namelength : 0x00000000 (0)
+ flag : 0x00000000 (0)
+ version : 0x00000001 (1)
+ id : DSPROPERTY_ZONE_NS_SERVERS_DA (146)
+ data : union dnsPropertyData(case 0)
+ name : 0x00000000 (0)
+dump OK
+'''
+ command = (
+ "ndrdump dnsp dnsp_DnsProperty_short struct --base64-input "
+ "--input AAAAAAAAAAAAAAAAAQAAAJIAAAAAAAAA")
+ try:
+ actual = self.check_output(command)
+ except BlackboxProcessError as e:
+ self.fail(e)
+ self.assertEqual(actual, expected)