From 51b131d3958e25a0a3439adfc02caf66e71f52d5 Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Wed, 25 Jul 2018 19:09:50 +0000 Subject: [PATCH] security/py-fail2ban: Fix writing /etc/hosts.deny entries PR: 227577 Submitted by: theis@gmx.at (maintainer) Reported by: Niels Bakker --- security/py-fail2ban/Makefile | 1 + .../patch-config_action.d_hostsdeny.conf | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 security/py-fail2ban/files/patch-config_action.d_hostsdeny.conf diff --git a/security/py-fail2ban/Makefile b/security/py-fail2ban/Makefile index 6c3c5b27d447..34bbcacef3f9 100644 --- a/security/py-fail2ban/Makefile +++ b/security/py-fail2ban/Makefile @@ -2,6 +2,7 @@ PORTNAME= fail2ban PORTVERSION= 0.10.3.1 +PORTREVISION= 1 CATEGORIES= security python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/security/py-fail2ban/files/patch-config_action.d_hostsdeny.conf b/security/py-fail2ban/files/patch-config_action.d_hostsdeny.conf new file mode 100644 index 000000000000..c89474e85962 --- /dev/null +++ b/security/py-fail2ban/files/patch-config_action.d_hostsdeny.conf @@ -0,0 +1,30 @@ +--- config/action.d/hostsdeny.conf.orig 2018-04-18 16:05:22.844045000 +0200 ++++ config/action.d/hostsdeny.conf 2018-04-18 16:06:30.930069000 +0200 +@@ -31,7 +31,7 @@ + # Tags: See jail.conf(5) man page + # Values: CMD + # +-actionban = printf %%b ": <_ip_value>\n" >> ++actionban = printf %%b ": \n" >> + + # Option: actionunban + # Notes.: command executed when unbanning an IP. Take care that the +@@ -39,7 +39,7 @@ + # Tags: See jail.conf(5) man page + # Values: CMD + # +-actionunban = IP=$(echo "<_ip_value>" | sed 's/[][\.]/\\\0/g') && sed -i "/^: $IP$/d" ++actionunban = IP=$(echo "" | /usr/bin/sed 's/\([][\.]\)/\\\1/g') && /usr/bin/sed -i "" "/^: $IP$/d" + + [Init] + +@@ -56,7 +56,7 @@ + daemon_list = ALL + + # internal variable IP (to differentiate the IPv4 and IPv6 syntax, where it is enclosed in brackets): +-_ip_value = ++ip_value = + + [Init?family=inet6] +-_ip_value = [] ++ip_value = []