From f8fdec2da8244ceb9d9fafcfa227c939b9f1976a Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Fri, 26 Jul 2019 13:32:44 -0400
Subject: [PATCH 70/73] fix: direct: removeRules() was mistakenly removing all
rules
Only remove the rules that match the specified criteria (ipv, table,
chain).
Fixes: #385
Fixes: rhbz 1723610
(cherry picked from commit 174005b15059db054b2f8dcf3b35c23fcbaf44ec)
(cherry picked from commit 5b796871894bc2f4f973ef11dc9233b4d391dd63)
---
src/firewall/server/config.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/firewall/server/config.py b/src/firewall/server/config.py
index 011052a9cabf..b2cebea9b4be 100644
--- a/src/firewall/server/config.py
+++ b/src/firewall/server/config.py
@@ -1367,7 +1367,9 @@ class FirewallDConfig(slip.dbus.service.Object):
(ipv, table, chain, ))
self.accessCheck(sender)
settings = list(self.getSettings())
- settings[1] = []
+ for rule in settings[1]:
+ if (ipv, table, chain) == (rule[0], rule[1], rule[2]):
+ settings[1].remove(rule)
self.update(tuple(settings))
@dbus_service_method(config.dbus.DBUS_INTERFACE_CONFIG_DIRECT,
--
2.20.1