diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff31db19..39c85231 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11.0-alpha.1', pypy2, pypy3] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11.0-beta.3', pypy2, pypy3] fail-fast: false # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -61,6 +61,8 @@ jobs: #sudo apt-get -y install python${F2B_PY/2/}-systemd || echo 'systemd not available' sudo apt-get -y install libsystemd-dev || echo 'systemd dependencies seems to be unavailable' python -m pip install systemd-python || echo 'systemd not available' + #readline if available as module: + python -c 'import readline' 2> /dev/null || python -m pip install readline || echo 'readline not available' - name: Before scripts run: | diff --git a/fail2ban/client/fail2banregex.py b/fail2ban/client/fail2banregex.py index 8c03b2dd..de7cde60 100644 --- a/fail2ban/client/fail2banregex.py +++ b/fail2ban/client/fail2banregex.py @@ -334,7 +334,7 @@ class Fail2banRegex(object): fltFile = None fltOpt = {} if regextype == 'fail': - if re.search(r'^(?ms)/{0,3}[\w/_\-.]+(?:\[.*\])?$', value): + if re.search(r'(?ms)^/{0,3}[\w/_\-.]+(?:\[.*\])?$', value): try: fltName, fltOpt = extractOptions(value) if "." in fltName[~5:]: diff --git a/fail2ban/server/actions.py b/fail2ban/server/actions.py index 558ef840..83c137ae 100644 --- a/fail2ban/server/actions.py +++ b/fail2ban/server/actions.py @@ -664,7 +664,7 @@ class Actions(JailThread, Mapping): if hasattr(action, 'consistencyCheck'): def _beforeRepair(): if stop and not getattr(action, 'actionrepair_on_unban', None): # don't need repair on stop - self._logSys.error("Invariant check failed. Flush is impossible.") + logSys.error("Invariant check failed. Flush is impossible.") return False return True action.consistencyCheck(_beforeRepair) diff --git a/fail2ban/server/datetemplate.py b/fail2ban/server/datetemplate.py index 8f1aaeb4..e02772d8 100644 --- a/fail2ban/server/datetemplate.py +++ b/fail2ban/server/datetemplate.py @@ -35,6 +35,7 @@ logSys = getLogger(__name__) # check already grouped contains "(", but ignores char "\(" and conditional "(?(id)...)": RE_GROUPED = re.compile(r'(?