From cab6f93364c7853ddc6ebeeb2de972a80b07add4 Mon Sep 17 00:00:00 2001 From: sebres Date: Wed, 3 Jan 2024 13:17:37 +0100 Subject: [PATCH] fail2ban-regex: fixes forgotten basedir (-c "$basedir") of jailreader --- fail2ban/client/fail2banregex.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fail2ban/client/fail2banregex.py b/fail2ban/client/fail2banregex.py index 8e78a489..160bde77 100644 --- a/fail2ban/client/fail2banregex.py +++ b/fail2ban/client/fail2banregex.py @@ -344,7 +344,7 @@ class Fail2banRegex(object): if re.search(r'(?ms)^[\w/_\-]+$', fltName): # name of jail? try: jail = JailReader(fltName, force_enable=True, - share_config=self.share_config) + share_config=self.share_config, basedir=basedir) jail.read() except NoJailError: jail = None @@ -406,7 +406,8 @@ class Fail2banRegex(object): fltName = os.path.abspath(fltName) if fltOpt: self.output( "Use filter options : %r" % fltOpt ) - reader = FilterReader(fltName, 'fail2ban-regex-jail', fltOpt, share_config=self.share_config, basedir=basedir) + reader = FilterReader(fltName, 'fail2ban-regex-jail', fltOpt, + share_config=self.share_config, basedir=basedir) ret = None try: if basedir is not None: