mirror of
https://github.com/samba-team/samba.git
synced 2025-12-23 00:23:53 +03:00
samba-tool: gpo show/load handle utf-16-le strings
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Tested-by: Kees van Vloten <keesvanvloten@gmail.com>
This commit is contained in:
committed by
Andrew Bartlett
parent
e603270360
commit
3b0d78a3fd
@@ -82,6 +82,7 @@ from samba.netcmd.gpcommon import (
|
||||
get_gpo_dn
|
||||
)
|
||||
from samba.policies import RegistryGroupPolicies
|
||||
from samba.dcerpc.misc import REG_MULTI_SZ
|
||||
|
||||
|
||||
def gpo_flags_string(value):
|
||||
@@ -669,7 +670,11 @@ class cmd_show(GPOCommand):
|
||||
defs['data'] = entry.data
|
||||
# Bytes aren't JSON serializable
|
||||
if type(defs['data']) == bytes:
|
||||
defs['data'] = list(defs['data'])
|
||||
if entry.type == REG_MULTI_SZ:
|
||||
data = defs['data'].decode('utf-16-le')
|
||||
defs['data'] = data.rstrip('\x00').split('\x00')
|
||||
else:
|
||||
defs['data'] = list(defs['data'])
|
||||
policy_defs.append(defs)
|
||||
self.outf.write("Policies :\n")
|
||||
json.dump(policy_defs, self.outf, indent=4)
|
||||
|
||||
Reference in New Issue
Block a user