From 51f1dcee55cf2d48bdea05435cd042c888028400 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sat, 28 May 2005 19:46:18 +0000 Subject: [PATCH] - Fixed textToDNS method which generated wrong matches for "rhost=12-xyz...". Thanks to Tom Pike git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@107 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- utils/dns.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/dns.py b/utils/dns.py index 9c8e47a7..ce629d69 100644 --- a/utils/dns.py +++ b/utils/dns.py @@ -37,8 +37,9 @@ def dnsToIp(dns): def textToDns(text): """ Search for possible DNS in an arbitrary text. + Thanks to Tom Pike. """ - match = re.findall("\S*\.\w*\.\w*", text) + match = re.findall("(?:(?:\w|-)+\.){2,}\w+", text) if match: return match else: