- Try to match the regex even if the line does not contain a valid date/time. Described in Debian #491253. Thanks to Yaroslav Halchenko.

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@712 a942ae1a-1317-0410-a47c-b1dcaea8d605
_tent/ipv6_via_aInfo
Cyril Jaquier 2008-08-12 22:40:07 +00:00
parent 8db3e1f74a
commit 6ee4843d11
2 changed files with 15 additions and 10 deletions

View File

@ -12,7 +12,11 @@ ver. 0.8.4 (2008/??/??) - stable
- Merged patches from Debian package. Thanks to Yaroslav
Halchenko.
- Use current day and month instead of Jan 1st if both are
not available in the log. Thanks to Andreas Itzchak Rehberg
not available in the log. Thanks to Andreas Itzchak
Rehberg.
- Try to match the regex even if the line does not contain a
valid date/time. Described in Debian #491253. Thanks to
Yaroslav Halchenko.
ver. 0.8.3 (2008/07/17) - stable
----------

View File

@ -241,15 +241,16 @@ class Filter(JailThread):
except UnicodeDecodeError:
l = line
timeMatch = self.dateDetector.matchTime(l)
if not timeMatch:
# There is no valid time in this line
return []
# Lets split into time part and log part of the line
timeLine = timeMatch.group()
# Lets leave the beginning in as well, so if there is no
# anchore at the beginning of the time regexp, we don't
# at least allow injection. Should be harmless otherwise
logLine = l[:timeMatch.start()] + l[timeMatch.end():]
if timeMatch:
# Lets split into time part and log part of the line
timeLine = timeMatch.group()
# Lets leave the beginning in as well, so if there is no
# anchore at the beginning of the time regexp, we don't
# at least allow injection. Should be harmless otherwise
logLine = l[:timeMatch.start()] + l[timeMatch.end():]
else:
timeLine = l
logLine = l
return self.findFailure(timeLine, logLine)
def processLineAndAdd(self, line):