]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gpo: Add rsop output for Sudoers policy
authorDavid Mulder <dmulder@suse.com>
Thu, 6 Aug 2020 18:44:41 +0000 (12:44 -0600)
committerDavid Mulder <dmulder@samba.org>
Thu, 27 Aug 2020 15:59:32 +0000 (15:59 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/gp_sudoers_ext.py
selftest/knownfail.d/gpo [deleted file]

index cbebc8f06e3c3d0ee2339701cc360ee2e6e536c7..6eb033a67c09dd21b651325f2be9dab69570d2f2 100644 (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
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