From: <los...@us...> - 2008-08-12 20:51:45
|
Revision: 708 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=708&view=rev Author: lostcontrol Date: 2008-08-12 20:51:55 +0000 (Tue, 12 Aug 2008) Log Message: ----------- - Use current day and month instead of Jan 1st if both are not available in the log. Thanks to Andreas Itzchak Rehberg. Modified Paths: -------------- branches/FAIL2BAN-0_8/ChangeLog branches/FAIL2BAN-0_8/server/datetemplate.py Modified: branches/FAIL2BAN-0_8/ChangeLog =================================================================== --- branches/FAIL2BAN-0_8/ChangeLog 2008-08-12 19:20:02 UTC (rev 707) +++ branches/FAIL2BAN-0_8/ChangeLog 2008-08-12 20:51:55 UTC (rev 708) @@ -11,6 +11,8 @@ ---------- - 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 ver. 0.8.3 (2008/07/17) - stable ---------- Modified: branches/FAIL2BAN-0_8/server/datetemplate.py =================================================================== --- branches/FAIL2BAN-0_8/server/datetemplate.py 2008-08-12 19:20:02 UTC (rev 707) +++ branches/FAIL2BAN-0_8/server/datetemplate.py 2008-08-12 20:51:55 UTC (rev 708) @@ -146,6 +146,11 @@ # that the log is not from this year but from the year before if time.mktime(date) > MyTime.time(): date[0] -= 1 + elif date[1] == 1 and date[2] == 1: + # If it is Jan 1st, it is either really Jan 1st or there + # is neither month nor day in the log. + date[1] = MyTime.gmtime()[1] + date[2] = MyTime.gmtime()[2] return date This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |