amend to 781321d609: better regex to detect jail name (it could contain dot etc)

This commit is contained in:
sebres 2024-04-02 18:02:07 +02:00
parent 302252b25c
commit 3b97182f62

View file

@ -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)