From: <los...@us...> - 2008-08-12 22:39:57
|
Revision: 712 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=712&view=rev Author: lostcontrol Date: 2008-08-12 22:40:07 +0000 (Tue, 12 Aug 2008) Log Message: ----------- - Try to match the regex even if the line does not contain a valid date/time. Described in Debian #491253. Thanks to Yaroslav Halchenko. Modified Paths: -------------- branches/FAIL2BAN-0_8/ChangeLog branches/FAIL2BAN-0_8/server/filter.py Modified: branches/FAIL2BAN-0_8/ChangeLog =================================================================== --- branches/FAIL2BAN-0_8/ChangeLog 2008-08-12 22:05:13 UTC (rev 711) +++ branches/FAIL2BAN-0_8/ChangeLog 2008-08-12 22:40:07 UTC (rev 712) @@ -12,7 +12,11 @@ - 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 ---------- Modified: branches/FAIL2BAN-0_8/server/filter.py =================================================================== --- branches/FAIL2BAN-0_8/server/filter.py 2008-08-12 22:05:13 UTC (rev 711) +++ branches/FAIL2BAN-0_8/server/filter.py 2008-08-12 22:40:07 UTC (rev 712) @@ -241,15 +241,16 @@ 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): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |