]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gpo: Add RSOP output for Scripts Extension
authorDavid Mulder <dmulder@suse.com>
Mon, 6 Jul 2020 17:16:45 +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_scripts_ext.py
selftest/knownfail.d/gpo [deleted file]

index 51ed66cee20fa72c84a268419e6a23b03b6a17cc..9bd828d0687d796ca3e5f01a4971b86a451028e9 100644 (file)
@@ -71,3 +71,19 @@ class gp_scripts_ext(gp_pol_ext):
                                 os.chmod(f.name, 0o700)
                                 self.gp_db.store(str(self), attribute, f.name)
                         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('Scripts') and e.data.strip():
+                    if key not in output.keys():
+                        output[key] = []
+                    output[key].append(e.data)
+        return output
diff --git a/selftest/knownfail.d/gpo b/selftest/knownfail.d/gpo
deleted file mode 100644 (file)
index b1c8285..0000000
+++ /dev/null
@@ -1 +0,0 @@
-samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop