mirror of https://github.com/fail2ban/fail2ban
- Improved regular expression checking
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@501 a942ae1a-1317-0410-a47c-b1dcaea8d6050.x
parent
812a47cc4a
commit
071474089b
|
@ -435,10 +435,18 @@ class Filter(JailThread):
|
||||||
+ "this format")
|
+ "this format")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
ipMatch = DNSUtils.textToIp(match.group("host"))
|
matchGroup = match.group("host")
|
||||||
if ipMatch:
|
# For strange reasons, match.group can return None with some
|
||||||
for ip in ipMatch:
|
# regular expressions. However, these expressions can be
|
||||||
failList.append([ip, date])
|
# compiled successfully.
|
||||||
|
if matchGroup == None:
|
||||||
|
logSys.error("Unexpected error. Please correct your "
|
||||||
|
+ "configuration.")
|
||||||
|
else:
|
||||||
|
ipMatch = DNSUtils.textToIp(match.group("host"))
|
||||||
|
if ipMatch:
|
||||||
|
for ip in ipMatch:
|
||||||
|
failList.append([ip, date])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
logSys.error("There is no 'host' group in the rule. " +
|
logSys.error("There is no 'host' group in the rule. " +
|
||||||
"Please correct your configuration.")
|
"Please correct your configuration.")
|
||||||
|
|
Loading…
Reference in New Issue