1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

gpo: Add rsop output for Sudoers policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
David Mulder
2020-08-06 12:44:41 -06:00
committed by David Mulder
parent 4148af125b
commit bc38d3afe3
2 changed files with 16 additions and 1 deletions

View File

@ -83,3 +83,19 @@ class gp_sudoers_ext(gp_pol_ext):
self.logger.warn('Sudoers apply "%s" failed'
% e.data)
self.gp_db.commit()
def rsop(self, gpo):
output = {}
pol_file = 'MACHINE/Registry.pol'
if gpo.file_sys_path:
path = os.path.join(gpo.file_sys_path, pol_file)
pol_conf = self.parse(path)
if not pol_conf:
return output
for e in pol_conf.entries:
key = e.keyname.split('\\')[-1]
if key.endswith('Sudo Rights') and e.data.strip():
if key not in output.keys():
output[key] = []
output[key].append(e.data)
return output