mirror of
https://github.com/fail2ban/fail2ban.git
synced 2025-11-26 14:20:19 +08:00
- Removed textToDns() which is not required anymore. Thanks to Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@605 a942ae1a-1317-0410-a47c-b1dcaea8d605
This commit is contained in:
@@ -503,17 +503,6 @@ class DNSUtils:
|
||||
% dns)
|
||||
return list()
|
||||
|
||||
@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
|
||||
|
||||
@staticmethod
|
||||
def searchIP(text):
|
||||
""" Search if an IP address if directly available and return
|
||||
@@ -549,11 +538,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
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user