From 4b2bd7e7762996fe5e0f493a23cd3f3b1de9a75c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 8 Feb 2008 00:52:04 -0500 Subject: [PATCH] Bye Bye dpatch: now everything is handled in git branches --- debian/control | 2 +- debian/patches/00_named_logtimeformat.dpatch | 23 -------- debian/patches/00list | 0 debian/patches/10_multiple_HOST_regexp.dpatch | 54 ------------------- debian/rules | 9 +--- 5 files changed, 3 insertions(+), 85 deletions(-) delete mode 100755 debian/patches/00_named_logtimeformat.dpatch delete mode 100644 debian/patches/00list delete mode 100755 debian/patches/10_multiple_HOST_regexp.dpatch diff --git a/debian/control b/debian/control index 45957b40..6e148821 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: fail2ban Section: net Priority: optional Maintainer: Yaroslav Halchenko -Build-Depends: debhelper (>= 5.0.37.2), dpatch, python +Build-Depends: debhelper (>= 5.0.37.2), python Build-Depends-Indep: python-central (>= 0.5.6) XS-Python-Version: current, >= 2.4 Homepage: http://www.fail2ban.org diff --git a/debian/patches/00_named_logtimeformat.dpatch b/debian/patches/00_named_logtimeformat.dpatch deleted file mode 100755 index 672f86e5..00000000 --- a/debian/patches/00_named_logtimeformat.dpatch +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 00_named_logtimeformat.dpatch by Yaroslav Halchenko -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad trunk~/server/datedetector.py trunk/server/datedetector.py ---- trunk~/server/datedetector.py 2007-04-01 16:42:08.000000000 -0400 -+++ trunk/server/datedetector.py 2007-07-29 22:28:52.000000000 -0400 -@@ -80,6 +80,12 @@ - template.setRegex("\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}") - template.setPattern("%Y-%m-%d %H:%M:%S") - self.__templates.append(template) -+ # named 26-Jul-2007 15:20:52.252 -+ template = DateStrptime() -+ template.setName("Day-Month-Year Hour:Minute:Second[.Millisecond]") -+ template.setRegex("\d{2}-\S{3}-\d{4} \d{2}:\d{2}:\d{2}") -+ template.setPattern("%d-%b-%Y %H:%M:%S") -+ self.__templates.append(template) - # TAI64N - template = DateTai64n() - template.setName("TAI64N") diff --git a/debian/patches/00list b/debian/patches/00list deleted file mode 100644 index e69de29b..00000000 diff --git a/debian/patches/10_multiple_HOST_regexp.dpatch b/debian/patches/10_multiple_HOST_regexp.dpatch deleted file mode 100755 index b791a932..00000000 --- a/debian/patches/10_multiple_HOST_regexp.dpatch +++ /dev/null @@ -1,54 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 10_multiple_HOST_regexp.dpatch by Yaroslav Halchenko -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: No description. - -@DPATCH@ -diff -urNad fail2ban-0.7.5~/server/filter.py fail2ban-0.7.5/server/filter.py ---- fail2ban-0.7.5~/server/filter.py 2006-11-26 15:37:31.000000000 -0500 -+++ fail2ban-0.7.5/server/filter.py 2006-12-22 13:30:25.000000000 -0500 -@@ -170,8 +170,17 @@ - self.__failRegex = value - self.__failRegexObj = None - else: -- # Replace "" with default regular expression for host. -- regex = value.replace("", "(?:::f{4,6}:)?(?P\S+)") -+ # Replace ""s with regular expression for a hostname, -+ # naming groups hostX where X is a number starting with 1 -+ regex = value -+ oldregex = ''; k = 0 -+ while ( regex != oldregex ): -+ oldregex = regex -+ k += 1 -+ regex = regex.replace("", -+ "(?:::f{4,6}:)?(?P\S+)" % k, -+ 1) -+ - self.__failRegex = regex - self.__failRegexObj = re.compile(regex) - logSys.info("Set failregex = %s" % self.__failRegex) -@@ -435,12 +444,18 @@ - + "this format") - else: - try: -- ipMatch = DNSUtils.textToIp(match.group("host")) -- if ipMatch: -- for ip in ipMatch: -- failList.append([ip, date]) -+ allGroups = match.groupdict() -+ hostRe = re.compile('host\d*$') -+ # Select only groups named host\d* -+ hostGroups = filter(lambda x: hostRe.match(x[0]) and x[1], -+ allGroups.iteritems()) -+ for hostGroup, hostEntry in hostGroups: -+ ipMatch = DNSUtils.textToIp(hostEntry) -+ if ipMatch: -+ for ip in ipMatch: -+ failList.append([ip, date]) - except IndexError: -- logSys.error("There is no 'host' group in the rule. " + -+ logSys.error("There is no 'hostX' group in the rule. " + - "Please correct your configuration.") - return failList - diff --git a/debian/rules b/debian/rules index 282e3140..3a51c192 100755 --- a/debian/rules +++ b/debian/rules @@ -11,19 +11,14 @@ DESTDIR=$(CURDIR)/debian/fail2ban -# no parallel execution -- required for dpatch -.NOTPARALLEL: - -include /usr/share/dpatch/dpatch.make - configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp -build: patch +build: -clean: clean-inits unpatch +clean: clean-inits dh_testdir dh_testroot rm -f build-stamp configure-stamp