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

gp: Fix rsop when final value isn't a str

The output must be a string value, or it will
crash. Chromium policies output integers, which
was causing the parser to crash.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Mulder
2022-12-09 09:40:34 -07:00
committed by Jeremy Allison
parent 74598eeef7
commit c435c105c5

View File

@@ -42,6 +42,8 @@ from samba.ndr import ndr_pack, ndr_unpack
from samba.credentials import SMB_SIGNING_REQUIRED
from samba.gp.util.logging import log
from hashlib import blake2b
import numbers
from samba.common import get_string
try:
from enum import Enum
@@ -718,7 +720,10 @@ def __rsop_vals(vals, level=4):
ret = [' '*level + '[ %s ]' % __rsop_vals(v, level+2) for v in vals]
return '\n' + '\n'.join(ret)
else:
return vals
if isinstance(vals, numbers.Number):
return ' '*(level+2) + str(vals)
else:
return ' '*(level+2) + get_string(vals)
def rsop(lp, creds, store, gp_extensions, username, target):
dc_hostname = get_dc_hostname(creds, lp)