From 3b97182f6294465bdf5c069ebbf746f41f47317d Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 2 Apr 2024 18:02:07 +0200 Subject: [PATCH] amend to 781321d6092d415e079439389e6e6588b8feaaa7: better regex to detect jail name (it could contain dot etc) --- fail2ban/client/fail2banregex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban/client/fail2banregex.py b/fail2ban/client/fail2banregex.py index 160bde77..d3615c8a 100644 --- a/fail2ban/client/fail2banregex.py +++ b/fail2ban/client/fail2banregex.py @@ -341,7 +341,7 @@ class Fail2banRegex(object): if re.search(r'(?ms)^/{0,3}[\w/_\-.]+(?:\[.*\])?$', value): try: fltName, fltOpt = extractOptions(value) - if re.search(r'(?ms)^[\w/_\-]+$', fltName): # name of jail? + if not re.search(r'(?ms)(?:/|\.(?:conf|local)$)', fltName): # name of jail? try: jail = JailReader(fltName, force_enable=True, share_config=self.share_config, basedir=basedir)