diff --git a/debian/changelog b/debian/changelog index a89a6e7f..96932468 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +fail2ban (0.11.2-6) unstable; urgency=medium + + * Cherry-pick upstream fix to fix a startup issue with Python 3.10 + (LP: #1958505) + + -- Sylvestre Ledru Thu, 10 Mar 2022 22:52:59 +0100 + fail2ban (0.11.2-5) unstable; urgency=medium * Revert the CVE-2021-32749 fix (Closes: #991449) diff --git a/debian/patches/python3.10.diff b/debian/patches/python3.10.diff new file mode 100644 index 00000000..dd43d5eb --- /dev/null +++ b/debian/patches/python3.10.diff @@ -0,0 +1,61 @@ +diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml +index 7a1d31df3d..262448c2da 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, pypy2, pypy3] ++ python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10.0-alpha.5', pypy2, pypy3] + fail-fast: false + # Steps represent a sequence of tasks that will be executed as part of the job + steps: +diff --git a/fail2ban/server/action.py b/fail2ban/server/action.py +index 3bc48fe046..f0f1e6f59a 100644 +--- a/fail2ban/server/action.py ++++ b/fail2ban/server/action.py +@@ -30,7 +30,10 @@ + import threading + import time + from abc import ABCMeta +-from collections import MutableMapping ++try: ++ from collections.abc import MutableMapping ++except ImportError: ++ from collections import MutableMapping + + from .failregex import mapTag2Opt + from .ipdns import DNSUtils +diff --git a/fail2ban/server/actions.py b/fail2ban/server/actions.py +index b7b95b445a..897d907c1a 100644 +--- a/fail2ban/server/actions.py ++++ b/fail2ban/server/actions.py +@@ -28,7 +28,10 @@ + import os + import sys + import time +-from collections import Mapping ++try: ++ from collections.abc import Mapping ++except ImportError: ++ from collections import Mapping + try: + from collections import OrderedDict + except ImportError: +diff --git a/fail2ban/server/jails.py b/fail2ban/server/jails.py +index 972a8c4bd2..27e12ddf65 100644 +--- a/fail2ban/server/jails.py ++++ b/fail2ban/server/jails.py +@@ -22,7 +22,10 @@ + __license__ = "GPL" + + from threading import Lock +-from collections import Mapping ++try: ++ from collections.abc import Mapping ++except ImportError: ++ from collections import Mapping + + from ..exceptions import DuplicateJailException, UnknownJailException + from .jail import Jail diff --git a/debian/patches/series b/debian/patches/series index 89bf8601..f94f4e73 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,3 +10,4 @@ debian_roundcube.diff systemd-run.diff scanlogd.patch 997601-use_2to3.diff +python3.10.diff