Skip to content

Commit

Permalink
fix(runtimeToPermanent): deepcopy settings before mangling
Browse files Browse the repository at this point in the history
Otherwise, doing a list.remove() will modify the runtime policy object
that is backing the "zone object". This was seen in runtimeToPermanent()
for runtime interfaces added by NetworkManager.

Fixes: RHEL-5802
(cherry picked from commit 84d4ed7)
  • Loading branch information
erig0 committed Oct 2, 2023
1 parent 56eaf88 commit 7d0618b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/firewall/server/firewalld.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def runtimeToPermanent(self, sender=None): # pylint: disable=W0613
config_names = self.config.getZoneNames()
for name in self.fw.zone.get_zones():
conf = self.getZoneSettings2(name)
settings = FirewallClientZoneSettings(conf)
settings = FirewallClientZoneSettings(copy.deepcopy(conf))
changed = False
for interface in settings.getInterfaces():
if interface in self.fw._nm_assigned_interfaces:
Expand Down

0 comments on commit 7d0618b

Please sign in to comment.