GPO: Add rsop output for Messages policy
authorDavid Mulder <dmulder@suse.com>
Wed, 19 Aug 2020 17:27:26 +0000 (11:27 -0600)
committerDavid Mulder <dmulder@samba.org>
Thu, 27 Aug 2020 17:19:48 +0000 (17:19 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): David Mulder <dmulder@samba.org>
Autobuild-Date(master): Thu Aug 27 17:19:48 UTC 2020 on sn-devel-184

python/samba/gp_msgs_ext.py
selftest/knownfail.d/gpo [deleted file]

index 5d8064072c2a85bc97ec9fe02bdf2968ce6b8219..9366cd826856bb77465aa111174bd8f9eb81d918 100644 (file)
@@ -66,3 +66,18 @@ class gp_msgs_ext(gp_pol_ext):
                             w.write(e.data)
                             self.gp_db.store(str(self), e.valuename, old_val)
                         self.gp_db.commit()
+
+    def rsop(self, gpo):
+        output = {}
+        if gpo.file_sys_path:
+            section_name = 'Software\\Policies\\Samba\\Unix Settings\\Messages'
+            pol_file = 'MACHINE/Registry.pol'
+            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:
+                if e.keyname == section_name and e.data.strip():
+                    mfile = os.path.join('/etc', e.valuename)
+                    output[mfile] = 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