From: David Mulder Date: Wed, 19 Aug 2020 17:27:26 +0000 (-0600) Subject: GPO: Add rsop output for Messages policy X-Git-Tag: samba-4.14.0rc1~1370 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=811e2f55290dc1af2439954f690b8b3c3749b607;p=samba.git GPO: Add rsop output for Messages policy Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall Autobuild-User(master): David Mulder Autobuild-Date(master): Thu Aug 27 17:19:48 UTC 2020 on sn-devel-184 --- diff --git a/python/samba/gp_msgs_ext.py b/python/samba/gp_msgs_ext.py index 5d8064072c2..9366cd82685 100644 --- a/python/samba/gp_msgs_ext.py +++ b/python/samba/gp_msgs_ext.py @@ -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 index b1c8285117f..00000000000 --- a/selftest/knownfail.d/gpo +++ /dev/null @@ -1 +0,0 @@ -samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop