From 3fd3454146fa223340ad3e1589806936cee0469b Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 11 Sep 2025 19:39:06 +0200 Subject: [PATCH] if parameter supplied to the config, overwrite also conditional init options (from `init?...` section) --- fail2ban/client/configreader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fail2ban/client/configreader.py b/fail2ban/client/configreader.py index 630ef32f..686b762e 100644 --- a/fail2ban/client/configreader.py +++ b/fail2ban/client/configreader.py @@ -354,6 +354,11 @@ class DefinitionInitConfigReader(ConfigReader): if v is None: v = getopt(opt) self._initOpts['known/'+opt] = v if opt not in self._initOpts: + # overwrite also conditional init options (from init?... section): + cond = SafeConfigParserWithIncludes.CONDITIONAL_RE.match(opt) + if cond: + optc, cond = cond.groups() + v = pOpts.get(optc, v) if v is None: v = getopt(opt) self._initOpts[opt] = v if all and self.has_section("Definition"):