1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

gpo: add list_gp_extensions for listing registered gp extensions

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
David Mulder 2018-06-13 14:46:30 -06:00 committed by Andrew Bartlett
parent b4f09af27a
commit 4436b6703c

View File

@ -557,6 +557,19 @@ def register_gp_extension(guid, name, path,
return True
def list_gp_extensions(smb_conf=None):
_, parser = parse_gpext_conf(smb_conf)
results = {}
for guid in parser.sections():
results[guid] = {}
results[guid]['DllName'] = parser.get(guid, 'DllName')
results[guid]['ProcessGroupPolicy'] = \
parser.get(guid, 'ProcessGroupPolicy')
results[guid]['MachinePolicy'] = \
not int(parser.get(guid, 'NoMachinePolicy'))
results[guid]['UserPolicy'] = not int(parser.get(guid, 'NoUserPolicy'))
return results
def unregister_gp_extension(guid, smb_conf=None):
if not check_guid(guid):
return False