From d0259bb790e0a071f64616e57f508bed7428c3be Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 9 Sep 2007 21:51:11 +0000 Subject: [PATCH] - Removed textToDns() which is not required anymore. Thanks to Yaroslav Halchenko git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@619 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 2 ++ server/filter.py | 22 ++++------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a547cb5d..58f07dba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,8 @@ ver. 0.9.0 (2007/??/??) - alpha - Fixed vulnerability in sshd.conf. Thanks to Daniel B. Cid - Expand in ignoreregex. Thanks to Yaroslav Halchenko - Improved regular expressions. Thanks to Yaroslav Halchenko +- Removed textToDns() which is not required anymore. Thanks + to Yaroslav Halchenko ver. 0.8.0 (2007/05/03) - stable ---------- diff --git a/server/filter.py b/server/filter.py index 52d2642a..c471d1e3 100644 --- a/server/filter.py +++ b/server/filter.py @@ -267,7 +267,7 @@ class Filter(JailThread): # @return True when the thread exits nicely def run(self): - raise Exception("run() is abstract") + raise NotImplementedException("run() is abstract") ## # Add an IP/DNS to the ignore list. @@ -494,18 +494,6 @@ class DNSUtils: return list() dnsToIp = staticmethod(dnsToIp) - #@staticmethod - def textToDns(text): - """ Search for possible DNS in an arbitrary text. - Thanks to Tom Pike. - """ - match = DNSUtils.DNS_CRE.match(text) - if match: - return match - else: - return None - textToDns = staticmethod(textToDns) - #@staticmethod def searchIP(text): """ Search if an IP address if directly available and return @@ -543,11 +531,9 @@ class DNSUtils: ipList.append(plainIPStr) if not ipList: # Try to get IP from possible DNS - dns = DNSUtils.textToDns(text) - if not dns == None: - ip = DNSUtils.dnsToIp(dns.group(0)) - for e in ip: - ipList.append(e) + ip = DNSUtils.dnsToIp(text) + for e in ip: + ipList.append(e) return ipList textToIp = staticmethod(textToIp)