1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

GPO: Add rsop output for smb.conf policy

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
David Mulder 2020-08-19 14:23:37 -06:00 committed by David Mulder
parent 101b5f17f1
commit fee00231f6
2 changed files with 17 additions and 1 deletions

View 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

View File

@ -1 +0,0 @@
samba.tests.gpo.samba.tests.gpo.GPOTests.test_rsop