From e2266672c2115ba9461df6f807729f4fc1f5b6ba Mon Sep 17 00:00:00 2001 From: Daniel Perna Date: Thu, 9 Aug 2018 00:23:52 +0200 Subject: [PATCH] Removing invalid values in case they slip through, Issue #109 --- configurator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configurator.py b/configurator.py index 87af57e..f053d95 100755 --- a/configurator.py +++ b/configurator.py @@ -3497,6 +3497,7 @@ def load_settings(settingsfile): ipaddress.ip_network(net) except Exception: LOG.warning("Invalid network in ALLOWED_NETWORKS: %s", net) + ALLOWED_NETWORKS.remove(net) BANNED_IPS = settings.get("BANNED_IPS", BANNED_IPS) if BANNED_IPS and not all(BANNED_IPS): LOG.warning("Invalid value for BANNED_IPS. Using empty list.") @@ -3506,6 +3507,7 @@ def load_settings(settingsfile): ipaddress.ip_address(banned_ip) except Exception: LOG.warning("Invalid IP address in BANNED_IPS: %s", banned_ip) + BANNED_IPS.remove(banned_ip) BANLIMIT = settings.get("BANLIMIT", BANLIMIT) DEV = settings.get("DEV", DEV) IGNORE_PATTERN = settings.get("IGNORE_PATTERN", IGNORE_PATTERN)