]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
GPO: Add rsop output for smb.conf policy
authorDavid Mulder <dmulder@suse.com>
Wed, 19 Aug 2020 20:23:37 +0000 (14:23 -0600)
committerDavid Mulder <dmulder@samba.org>
Thu, 27 Aug 2020 15:59:34 +0000 (15:59 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/gp_smb_conf_ext.py
selftest/knownfail.d/gpo [deleted file]

index a67c7ea1278ae71853fe083810cf5163368c003c..5461e0d9b25d4fee6bdfec3b251a6de7be4a9e34 100644 (file)
@@ -83,3 +83,20 @@ class gp_smb_conf_ext(gp_pol_ext):
 
     def __str__(self):
         return "smb.conf"
+
+    def rsop(self, gpo):
+        output = {}
+        if gpo.file_sys_path:
+            section_name = 'Software\\Policies\\Samba\\smb_conf'
+            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 not e.keyname.startswith(section_name):
+                    continue
+                if 'smb.conf' not in output.keys():
+                    output['smb.conf'] = {}
+                output['smb.conf'][e.valuename] = 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