From 1f631030410c8dba0567e651346fc92facd0e22d Mon Sep 17 00:00:00 2001 From: David Mulder Date: Mon, 6 Jul 2020 11:16:14 -0600 Subject: [PATCH] gpo: Add RSOP output for Security Extension Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall --- python/samba/gp_sec_ext.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/python/samba/gp_sec_ext.py b/python/samba/gp_sec_ext.py index 6eab975e6fe..6fac91294d5 100644 --- a/python/samba/gp_sec_ext.py +++ b/python/samba/gp_sec_ext.py @@ -204,3 +204,19 @@ class gp_sec_ext(gp_inf_ext): self.creds, att, value).update_samba() self.gp_db.commit() + def rsop(self, gpo): + output = {} + inf_file = 'MACHINE/Microsoft/Windows NT/SecEdit/GptTmpl.inf' + apply_map = self.apply_map() + if gpo.file_sys_path: + path = os.path.join(gpo.file_sys_path, inf_file) + inf_conf = self.parse(path) + if not inf_conf: + return output + for section in inf_conf.sections(): + current_section = apply_map.get(section) + if not current_section: + continue + output[section] = {k: v for k, v in inf_conf.items(section) \ + if current_section.get(k)} + return output -- 2.47.3