mirror of https://github.com/fail2ban/fail2ban
- Fixed bug #1241756
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@147 a942ae1a-1317-0410-a47c-b1dcaea8d6050.5
parent
5dbed848bc
commit
bbfc65f569
|
@ -186,6 +186,12 @@ class LogReader:
|
|||
"""
|
||||
date = list(time.strptime(value, self.timepattern))
|
||||
if date[0] < 2000:
|
||||
# There is probably no year field in the logs
|
||||
date[0] = time.gmtime()[0]
|
||||
# Bug fix for #1241756
|
||||
# If the date is greater than the current time, we suppose
|
||||
# that the log is not from this year but from the year before
|
||||
if date > time.time():
|
||||
date[0] -= 1
|
||||
unixTime = time.mktime(date)
|
||||
return unixTime
|
||||
|
|
Loading…
Reference in New Issue