Blob Blame History Raw
From 8ec42cd1041ba342c9f87f51b62f80be278f682b Mon Sep 17 00:00:00 2001
From: Eric Garver <e@erig.me>
Date: Tue, 21 Nov 2017 16:04:23 -0500
Subject: [PATCH] firewalld: also reload dbus config interface for global
 options

These options require the firewall to be reloaded, but it was not also
reloading the dbus config interface. The interface objects would end up
pointing to stale cleanup()'d config objects (via firewall.core.fw
reload()). Therefore we also need to reload/refresh the config
interface.

Fixes: rhbz 1514043
---
 src/firewall/core/fw.py          | 6 ------
 src/firewall/server/firewalld.py | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/firewall/core/fw.py b/src/firewall/core/fw.py
index 0dda11d49116..2a119b1dc4d4 100644
--- a/src/firewall/core/fw.py
+++ b/src/firewall/core/fw.py
@@ -1142,9 +1142,6 @@ class Firewall(object):
             self._log_denied = value
             self._firewalld_conf.set("LogDenied", value)
             self._firewalld_conf.write()
-
-            # now reload the firewall
-            self.reload()
         else:
             raise FirewallError(errors.ALREADY_SET, value)
 
@@ -1163,9 +1160,6 @@ class Firewall(object):
             self._automatic_helpers = value
             self._firewalld_conf.set("AutomaticHelpers", value)
             self._firewalld_conf.write()
-
-            # now reload the firewall
-            self.reload()
         else:
             raise FirewallError(errors.ALREADY_SET, value)
 
diff --git a/src/firewall/server/firewalld.py b/src/firewall/server/firewalld.py
index 9c5d463de793..fc7422f12261 100644
--- a/src/firewall/server/firewalld.py
+++ b/src/firewall/server/firewalld.py
@@ -939,6 +939,10 @@ class FirewallD(slip.dbus.service.Object):
         self.accessCheck(sender)
         self.fw.set_log_denied(value)
         self.LogDeniedChanged(value)
+        # must reload the firewall as well
+        self.fw.reload()
+        self.config.reload()
+        self.Reloaded()
 
     @dbus.service.signal(config.dbus.DBUS_INTERFACE, signature='s')
     @dbus_handle_exceptions
@@ -969,6 +973,10 @@ class FirewallD(slip.dbus.service.Object):
         self.accessCheck(sender)
         self.fw.set_automatic_helpers(value)
         self.AutomaticHelpersChanged(value)
+        # must reload the firewall as well
+        self.fw.reload()
+        self.config.reload()
+        self.Reloaded()
 
     @dbus.service.signal(config.dbus.DBUS_INTERFACE, signature='s')
     @dbus_handle_exceptions
-- 
2.12.0