From 3e1ea61d18cb222dbeebe794544f40f1c700491be52e42df11160c749257d816 Mon Sep 17 00:00:00 2001 From: Johannes Weberhofer Date: Mon, 15 Nov 2021 16:57:14 +0000 Subject: [PATCH] Accepting request 931135 from home:weberho:branches:security - Added fail2ban-0.11.2-upstream-patch-python-3.10.patch to allow fail2ban run under under python 3.9+ - Shifted the order of the patches OBS-URL: https://build.opensuse.org/request/show/931135 OBS-URL: https://build.opensuse.org/package/show/security/fail2ban?expand=0&rev=108 --- ...ban-0.11.2-upstream-patch-python-3.9.patch | 103 ++++++++++++++++++ fail2ban.changes | 8 ++ fail2ban.spec | 6 +- 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 fail2ban-0.11.2-upstream-patch-python-3.9.patch diff --git a/fail2ban-0.11.2-upstream-patch-python-3.9.patch b/fail2ban-0.11.2-upstream-patch-python-3.9.patch new file mode 100644 index 0000000..0ce8224 --- /dev/null +++ b/fail2ban-0.11.2-upstream-patch-python-3.9.patch @@ -0,0 +1,103 @@ +From 8ae9208454e426aa87b96ba5df26036c4ae5cefd Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 16:44:27 +0100 +Subject: [PATCH 1/4] try to provide coverage for 3.10-alpha.5 (#2931) + +--- + .github/workflows/main.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +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: + +From 2b6bb2c1bed8f7009631e8f8c306fa3160324a49 Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 17:19:24 +0100 +Subject: [PATCH 2/4] follow bpo-37324: + :ref:`collections-abstract-base-classes` moved to the :mod:`collections.abc` + module + +(since 3.10-alpha.5 `MutableMapping` is missing in collections module) +--- + fail2ban/server/action.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +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 + +From 42dee38ad2ac5c3f23bdf297d824022923270dd9 Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 17:25:45 +0100 +Subject: [PATCH 3/4] amend for `Mapping` + +--- + fail2ban/server/actions.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +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: + +From 9f1d1f4fbd0804695a976beb191f2c49a2739834 Mon Sep 17 00:00:00 2001 +From: "Sergey G. Brester" +Date: Mon, 8 Feb 2021 17:35:59 +0100 +Subject: [PATCH 4/4] amend for `Mapping` (jails) + +--- + fail2ban/server/jails.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +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/fail2ban.changes b/fail2ban.changes index 07e580b..7834f8a 100644 --- a/fail2ban.changes +++ b/fail2ban.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Nov 12 10:49:20 UTC 2021 - Johannes Weberhofer + +- Added fail2ban-0.11.2-upstream-patch-python-3.10.patch to allow + fail2ban run under under python 3.9+ + +- Shifted the order of the patches + ------------------------------------------------------------------- Tue Sep 14 07:47:32 UTC 2021 - Johannes Segitz diff --git a/fail2ban.spec b/fail2ban.spec index 04a7c71..68d3643 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -49,9 +49,12 @@ Patch200: %{name}-disable-iptables-w-option.patch Patch201: %{name}-0.10.4-env-script-interpreter.patch # PATCH-FEATURE-OPENSUSE fail2ban-opensuse-service-sfw.patch jweberhofer@weberhofer.at -- start after SuSEfirewall2 only for older distributions Patch300: fail2ban-opensuse-service-sfw.patch +# PATCH-FEATURE-OPENSUSE harden_fail2ban.service.patch jsegitz@suse.com -- Added hardening to systemd service(s) bsc#1181400 +Patch301: harden_fail2ban.service.patch # PATCH-FIX-UPSTREAM fail2ban-0.11.2-upstream-patch-for-CVE-2021-32749.patch jweberhofer@weberhofer.at -- fixes CVE-2021-32749 Patch400: fail2ban-0.11.2-upstream-patch-for-CVE-2021-32749.patch -Patch401: harden_fail2ban.service.patch +# PATCH-FIX-UPSTREAM fail2ban-0.11.2-upstream-patch-python-3.10.patch jweberhofer@weberhofer.at -- allow running under python 3.9+ +Patch401: fail2ban-0.11.2-upstream-patch-python-3.9.patch BuildRequires: fdupes BuildRequires: logrotate @@ -137,6 +140,7 @@ sed -i -e 's/^before = paths-.*/before = paths-opensuse.conf/' config/jail.conf %if !0%{?suse_version} > 1500 %patch300 -p1 %endif +%patch301 -p1 %patch400 -p1 %patch401 -p1