1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

gpo: Ensure empty Security sections are removed

Failing to remove the empty section causes tests
to fail, and is also just bad practice.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Mulder 2020-12-11 10:38:32 -07:00 committed by Jeremy Allison
parent c27c97ab55
commit ff4279575f
2 changed files with 2 additions and 1 deletions

View File

@ -1986,6 +1986,8 @@ PasswordComplexity Password must meet complexity requirements
inf_data.set(section, policy, value)
else:
inf_data.remove_option(section, policy)
if len(inf_data.options(section)) == 0:
inf_data.remove_section(section)
out = StringIO()
inf_data.write(out)

View File

@ -1 +0,0 @@
^samba.tests.samba_tool.gpo.samba.tests.samba_tool.gpo.GpoCmdTestCase.test_security_nonempty_sections