[Snort-users] (Patch) One month offset in database plugin

Lee Chu lee at ...405...
Fri Sep 1 10:41:03 EDT 2000


I noticed that the timestamps were a month behind in the database plugin,
and it is due to the fact that tm->tm_mon is in the range 0 - 11.  This is
from today's CVS.

Lee

diff -Nur snort.old/plugbase.c snort/plugbase.c
--- snort.old/plugbase.c	Fri Sep  1 09:21:15 2000
+++ snort/plugbase.c	Fri Sep  1 09:21:47 2000
@@ -880,9 +880,9 @@
     time = localtime(tv_sec);
 
     if (tz < 0)
-    snprintf(buf, SMALLBUFFER, "%04i-%02i-%02i %02i:%02i:%02i%03i", 1900 + time->tm_year, time->tm_mon, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec, tz);
+    snprintf(buf, SMALLBUFFER, "%04i-%02i-%02i %02i:%02i:%02i%03i", 1900 + time->tm_year, time->tm_mon + 1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec, tz);
     else
-    snprintf(buf, SMALLBUFFER, "%04i-%02i-%02i %02i:%02i:%02i+%02i", 1900 + time->tm_year, time->tm_mon, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec, tz);
+    snprintf(buf, SMALLBUFFER, "%04i-%02i-%02i %02i:%02i:%02i+%02i", 1900 + time->tm_year, time->tm_mon + 1, time->tm_mday, time->tm_hour, time->tm_min, time->tm_sec, tz);
 
     return buf;
 }




More information about the Snort-users mailing list