From ed8043cdfacc43ee6b3b5f52f6bedb7bf0953369 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 3 Feb 2016 20:13:01 +0000 Subject: [PATCH 1/4] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- fail2ban.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fail2ban.spec b/fail2ban.spec index 2b069d6..6b21974 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -1,7 +1,7 @@ Summary: Daemon to ban hosts that cause multiple authentication errors Name: fail2ban Version: 0.9.3 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: http://fail2ban.sourceforge.net/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -270,6 +270,9 @@ fi %changelog +* Wed Feb 03 2016 Fedora Release Engineering - 0.9.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Sat Sep 12 2015 Orion Poplawski - 0.9.3-1 - Update to 0.9.3 - Cleanup spec, use new python macros From 3454a2012a174aea6aa8ef1a64b9773f86ff0334 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Tue, 23 Feb 2016 11:23:57 -0700 Subject: [PATCH 2/4] Use python3 (bug #1282498) --- fail2ban.spec | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/fail2ban.spec b/fail2ban.spec index 6b21974..8a7d9f6 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -1,7 +1,7 @@ Summary: Daemon to ban hosts that cause multiple authentication errors Name: fail2ban Version: 0.9.3 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: http://fail2ban.sourceforge.net/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -9,9 +9,11 @@ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-% # https://github.com/fail2ban/fail2ban/issues/1155 Patch0: https://github.com/yarikoptic/fail2ban/commit/3187de29336b4a01e4dcd20f98253e1db913ee7a.patch -BuildRequires: python-devel +BuildRequires: python3-devel +# For 2to3 +BuildRequires: python2-tools # For testcases -BuildRequires: python-inotify +BuildRequires: python3-inotify BuildArch: noarch %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd @@ -42,7 +44,7 @@ configurations. %package server Summary: Core server component for Fail2Ban %if 0%{?fedora} || 0%{?rhel} >= 7 -Requires: systemd-python +Requires: python3-systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -69,10 +71,12 @@ Requires: %{name}-mail = %{version}-%{release} Requires: %{name}-sendmail = %{version}-%{release} Requires: %{name}-server = %{version}-%{release} Requires: %{name}-shorewall = %{version}-%{release} +# Currently this breaks jails that don't log to the journal #Requires: %{name}-systemd = %{version}-%{release} -Requires: gamin-python +# No python3 support for gamin +#Requires: gamin-python Requires: perl -Requires: python-inotify +Requires: python3-inotify Requires: /usr/bin/whois %description all @@ -145,12 +149,13 @@ by default. sed -i -e 's/^before = paths-.*/before = paths-fedora.conf/' config/jail.conf # Start after firewalld (https://bugzilla.redhat.com/show_bug.cgi?id=1067147) sed -i -e '/^After=/s/$/ firewalld.service/' files/fail2ban.service +2to3 --write --nobackups . %build -%py_build +%py3_build %install -%py_install +%py3_install %if 0%{?fedora} || 0%{?rhel} >= 7 mkdir -p %{buildroot}%{_unitdir} @@ -195,7 +200,7 @@ rm -r %{buildroot}%{_docdir}/%{name} %check # Need a UTF-8 locale to work export LANG=en_US.UTF-8 -./fail2ban-testcases-all --no-network +./fail2ban-testcases-all-python3 --no-network %post server %if 0%{?fedora} || 0%{?rhel} >= 7 @@ -227,7 +232,7 @@ fi %{_bindir}/fail2ban-client %{_bindir}/fail2ban-regex %{_bindir}/fail2ban-testcases -%{python_sitelib}/* +%{python3_sitelib}/* %if 0%{?fedora} || 0%{?rhel} >= 7 %{_unitdir}/fail2ban.service %else @@ -270,6 +275,9 @@ fi %changelog +* Tue Feb 23 2016 Orion Poplawski - 0.9.3-3 +- Use python3 (bug #1282498) + * Wed Feb 03 2016 Fedora Release Engineering - 0.9.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From b818fb6ecc30e7f14604dffdd2a48604cbc845c8 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 9 Mar 2016 11:55:10 -0700 Subject: [PATCH 3/4] Update to 0.9.4 - Use mariadb log path by default --- .gitignore | 1 + ...de29336b4a01e4dcd20f98253e1db913ee7a.patch | 50 ------------------- fail2ban-mysql.patch | 13 +++++ fail2ban-test.patch | 12 +++++ fail2ban.spec | 17 +++++-- sources | 2 +- 6 files changed, 40 insertions(+), 55 deletions(-) delete mode 100644 3187de29336b4a01e4dcd20f98253e1db913ee7a.patch create mode 100644 fail2ban-mysql.patch create mode 100644 fail2ban-test.patch diff --git a/.gitignore b/.gitignore index d3132d5..bf86dda 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ fail2ban-0.8.4.tar.bz2 /fail2ban-0.9.1.tar.gz /fail2ban-0.9.2.tar.gz /fail2ban-0.9.3.tar.gz +/fail2ban-0.9.4.tar.gz diff --git a/3187de29336b4a01e4dcd20f98253e1db913ee7a.patch b/3187de29336b4a01e4dcd20f98253e1db913ee7a.patch deleted file mode 100644 index e516462..0000000 --- a/3187de29336b4a01e4dcd20f98253e1db913ee7a.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3187de29336b4a01e4dcd20f98253e1db913ee7a Mon Sep 17 00:00:00 2001 -From: Yaroslav Halchenko -Date: Sat, 12 Sep 2015 14:15:10 -0400 -Subject: [PATCH] BF(TST): allow exception and False for executeCmd due to - inconsistent behavior across bash/dash - -Temporary minimalistic fix to the test ---- - fail2ban/tests/actiontestcase.py | 23 +++++++++++++++++------ - 1 file changed, 17 insertions(+), 6 deletions(-) - -diff --git a/fail2ban/tests/actiontestcase.py b/fail2ban/tests/actiontestcase.py -index febbc61..73dee12 100644 ---- a/fail2ban/tests/actiontestcase.py -+++ b/fail2ban/tests/actiontestcase.py -@@ -222,17 +222,28 @@ def getnastypid(): - return int(f.read()) - - # First test if can kill the bastard -- self.assertRaises( -- RuntimeError, CommandAction.executeCmd, 'bash %s' % tmpFilename, timeout=.1) -+ try: -+ self.assertFalse( -+ CommandAction.executeCmd('bash %s' % tmpFilename, timeout=.1)) -+ except RuntimeError: -+ # this one is expected behavior, see -+ # https://github.com/fail2ban/fail2ban/issues/1155#issuecomment-139799958 -+ pass - # Verify that the proccess itself got killed - self.assertFalse(pid_exists(getnastypid())) # process should have been killed - self.assertTrue(self._is_logged('timed out')) -- self.assertTrue(self._is_logged('killed with SIGTERM')) -+ self.assertTrue(self._is_logged('Terminated')) - - # A bit evolved case even though, previous test already tests killing children processes -- self.assertRaises( -- RuntimeError, CommandAction.executeCmd, 'out=`bash %s`; echo ALRIGHT' % tmpFilename, -- timeout=.2) -+ try: -+ self.assertFalse( -+ CommandAction.executeCmd('out=`bash %s`; echo ALRIGHT' % tmpFilename, -+ timeout=.2)) -+ except RuntimeError: -+ # this one is expected behavior, see -+ # https://github.com/fail2ban/fail2ban/issues/1155#issuecomment-139799958 -+ pass -+ - # Verify that the proccess itself got killed - self.assertFalse(pid_exists(getnastypid())) - self.assertTrue(self._is_logged('timed out')) diff --git a/fail2ban-mysql.patch b/fail2ban-mysql.patch new file mode 100644 index 0000000..5efa807 --- /dev/null +++ b/fail2ban-mysql.patch @@ -0,0 +1,13 @@ +diff --git a/config/paths-fedora.conf b/config/paths-fedora.conf +index b3c978c..e91845a 100644 +--- a/config/paths-fedora.conf ++++ b/config/paths-fedora.conf +@@ -34,7 +34,7 @@ apache_access_log = /var/log/httpd/*access_log + + exim_main_log = /var/log/exim/main.log + +-mysql_log = /var/lib/mysql/mysqld.log ++mysql_log = /var/log/mariadb/mariadb.log + + roundcube_errors_log = /var/log/roundcubemail/errors + diff --git a/fail2ban-test.patch b/fail2ban-test.patch new file mode 100644 index 0000000..1522ece --- /dev/null +++ b/fail2ban-test.patch @@ -0,0 +1,12 @@ +diff -up fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py.test fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py +--- fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py.test 2016-03-09 10:43:53.649645648 -0700 ++++ fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py 2016-03-09 11:00:19.208546116 -0700 +@@ -632,8 +632,6 @@ class JailsReaderTest(LogCaptureTestCase + + # and we know even some of them by heart + for j in ['sshd', 'recidive']: +- # by default we have 'auto' backend ATM +- self.assertTrue(['add', j, 'auto'] in comm_commands) + # and warn on useDNS + self.assertTrue(['set', j, 'usedns', 'warn'] in comm_commands) + self.assertTrue(['start', j] in comm_commands) diff --git a/fail2ban.spec b/fail2ban.spec index 8a7d9f6..d7024c0 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -1,13 +1,17 @@ Summary: Daemon to ban hosts that cause multiple authentication errors Name: fail2ban -Version: 0.9.3 -Release: 3%{?dist} +Version: 0.9.4 +Release: 1%{?dist} License: GPLv2+ URL: http://fail2ban.sourceforge.net/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +#Source0: https://github.com/sebres/%{name}/archive/f2b-perfom-prepare-716-cs.tar.gz#/%{name}-test.tar.gz # Fix failing test -# https://github.com/fail2ban/fail2ban/issues/1155 -Patch0: https://github.com/yarikoptic/fail2ban/commit/3187de29336b4a01e4dcd20f98253e1db913ee7a.patch +# https://github.com/fail2ban/fail2ban/issues/1353 +Patch0: fail2ban-test.patch +# Fix mysql log path +# https://github.com/fail2ban/fail2ban/issues/1354 +Patch1: fail2ban-mysql.patch BuildRequires: python3-devel # For 2to3 @@ -145,6 +149,7 @@ by default. %prep %setup -q %patch0 -p1 -b .test +%patch1 -p1 -b .mysql # Use Fedora paths sed -i -e 's/^before = paths-.*/before = paths-fedora.conf/' config/jail.conf # Start after firewalld (https://bugzilla.redhat.com/show_bug.cgi?id=1067147) @@ -275,6 +280,10 @@ fi %changelog +* Wed Mar 9 2016 Orion Poplawski - 0.9.4-1 +- Update to 0.9.4 +- Use mariadb log path by default + * Tue Feb 23 2016 Orion Poplawski - 0.9.3-3 - Use python3 (bug #1282498) diff --git a/sources b/sources index 29e969c..6113bd9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -73c87c545cc6474de984b5a05e64ecab fail2ban-0.9.3.tar.gz +2dc93dff03c4da9fb95d4695e07b65d8 fail2ban-0.9.4.tar.gz From 1e5fef520eacf80463ffaf1feefa4ad70d7f6d5a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 9 Mar 2016 12:02:13 -0700 Subject: [PATCH 4/4] Revert "Use python3 (bug #1282498)" This reverts commit 3454a2012a174aea6aa8ef1a64b9773f86ff0334. Conflicts: fail2ban.spec --- fail2ban.spec | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/fail2ban.spec b/fail2ban.spec index d7024c0..ab85ba6 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -13,11 +13,9 @@ Patch0: fail2ban-test.patch # https://github.com/fail2ban/fail2ban/issues/1354 Patch1: fail2ban-mysql.patch -BuildRequires: python3-devel -# For 2to3 -BuildRequires: python2-tools +BuildRequires: python-devel # For testcases -BuildRequires: python3-inotify +BuildRequires: python-inotify BuildArch: noarch %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd @@ -48,7 +46,7 @@ configurations. %package server Summary: Core server component for Fail2Ban %if 0%{?fedora} || 0%{?rhel} >= 7 -Requires: python3-systemd +Requires: systemd-python Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -75,12 +73,10 @@ Requires: %{name}-mail = %{version}-%{release} Requires: %{name}-sendmail = %{version}-%{release} Requires: %{name}-server = %{version}-%{release} Requires: %{name}-shorewall = %{version}-%{release} -# Currently this breaks jails that don't log to the journal #Requires: %{name}-systemd = %{version}-%{release} -# No python3 support for gamin -#Requires: gamin-python +Requires: gamin-python Requires: perl -Requires: python3-inotify +Requires: python-inotify Requires: /usr/bin/whois %description all @@ -154,13 +150,12 @@ by default. sed -i -e 's/^before = paths-.*/before = paths-fedora.conf/' config/jail.conf # Start after firewalld (https://bugzilla.redhat.com/show_bug.cgi?id=1067147) sed -i -e '/^After=/s/$/ firewalld.service/' files/fail2ban.service -2to3 --write --nobackups . %build -%py3_build +%py_build %install -%py3_install +%py_install %if 0%{?fedora} || 0%{?rhel} >= 7 mkdir -p %{buildroot}%{_unitdir} @@ -205,7 +200,7 @@ rm -r %{buildroot}%{_docdir}/%{name} %check # Need a UTF-8 locale to work export LANG=en_US.UTF-8 -./fail2ban-testcases-all-python3 --no-network +./fail2ban-testcases-all --no-network %post server %if 0%{?fedora} || 0%{?rhel} >= 7 @@ -237,7 +232,7 @@ fi %{_bindir}/fail2ban-client %{_bindir}/fail2ban-regex %{_bindir}/fail2ban-testcases -%{python3_sitelib}/* +%{python_sitelib}/* %if 0%{?fedora} || 0%{?rhel} >= 7 %{_unitdir}/fail2ban.service %else @@ -284,9 +279,6 @@ fi - Update to 0.9.4 - Use mariadb log path by default -* Tue Feb 23 2016 Orion Poplawski - 0.9.3-3 -- Use python3 (bug #1282498) - * Wed Feb 03 2016 Fedora Release Engineering - 0.9.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild