]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gpo: Add RSOP output for Security Extension
authorDavid Mulder <dmulder@suse.com>
Mon, 6 Jul 2020 17:16:14 +0000 (11:16 -0600)
committerDavid Mulder <dmulder@samba.org>
Thu, 6 Aug 2020 16:38:36 +0000 (16:38 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/gp_sec_ext.py

index 6eab975e6feef4f5ce645bdf0ca15a9a445e2359..6fac91294d5e9c0f343a3848230cc6f57c5444b8 100644 (file)
@@ -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