From 49f9143535fe3b17e89193bc417af7ae25bc6541 Mon Sep 17 00:00:00 2001 From: Steven Hiscocks Date: Wed, 18 Dec 2013 21:06:03 +0000 Subject: [PATCH] ENH: Set date to "today" when neither month nor day is time match --- fail2ban/server/datetemplate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fail2ban/server/datetemplate.py b/fail2ban/server/datetemplate.py index 87c53df5..5e22fd95 100644 --- a/fail2ban/server/datetemplate.py +++ b/fail2ban/server/datetemplate.py @@ -208,7 +208,8 @@ class DateStrptime(DateTemplate): # If it is Jan 1st, it is either really Jan 1st or there # is neither month nor day in the log. # NOTE: Possibly makes week/year day incorrect - date = date.replace(month=MyTime.gmtime()[1], day=1) + date = date.replace( + month=MyTime.gmtime()[1], day=MyTime.gmtime()[2]) if date.tzinfo: return ( calendar.timegm(date.utctimetuple()), dateMatch )