From: David Mulder Date: Mon, 6 Jul 2020 17:16:45 +0000 (-0600) Subject: gpo: Add RSOP output for Scripts Extension X-Git-Tag: talloc-2.3.2~923 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf74bf1c4ea11074919a5197c7d8975658291cb1;p=thirdparty%2Fsamba.git gpo: Add RSOP output for Scripts Extension Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/gp_scripts_ext.py b/python/samba/gp_scripts_ext.py index 51ed66cee20..9bd828d0687 100644 --- a/python/samba/gp_scripts_ext.py +++ b/python/samba/gp_scripts_ext.py @@ -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 index b1c8285117f..00000000000 --- a/selftest/knownfail.d/gpo +++ /dev/null @@ -1 +0,0 @@ -samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop