1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-13 16:23:50 +03:00

gp_pol: Allow null data for REG_MULTI_SZ

The parser is able to convert data from binary to XML (it generates an
empty <Value> tag) but not the other way around. This is a common
occurrence for empty multitext fields.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
This commit is contained in:
Gabriel Nagy
2023-10-24 12:47:02 +03:00
committed by David Mulder
parent 9c5a924428
commit d5d96bed02
2 changed files with 5 additions and 2 deletions

View File

@@ -77,7 +77,11 @@ class GPPolParser(GPParser):
if misc.REG_MULTI_SZ == entry_type:
values = [x.text for x in e.findall('Value')]
entry.data = (u'\x00'.join(values) + u'\x00\x00').encode('utf-16le')
if values == [None]:
data = u'\x00'
else:
data = u'\x00'.join(values) + u'\x00\x00'
entry.data = data.encode('utf-16le')
elif (misc.REG_NONE == entry_type):
pass
elif (misc.REG_SZ == entry_type or