>Number:         1343
>Category:       suexec
>Synopsis:       year-2000 bug in suexec log
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Oct 31 13:50:00 PST 1997
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.2.4
>Environment:
SunOS shade.twinsun.com 5.6 Generic sun4u sparc SUNW,Ultra-1
>Description:
suexec assumes that tm_year is the year modulo 100, but it's actually
the year - 1900.  This will cause suexec to generate bogus logs after 1999.

While we're on the subject, dates like `01-02-03' are confusing and ambiguous.
It's better to use ISO 8601 format dates like `2003-01-02'.
Also, put the date first, so that timestamps sort correctly.
>How-To-Repeat:

>Fix:
--- suexec.c    1997/06/29 17:41:29     1.2.4.0
+++ suexec.c    1997/10/31 21:32:59     1.2.4.1
@@ -152,6 +152,7 @@ static void err_output(const char *fmt, 
     lt = localtime(&timevar);
     
-    fprintf(log, "[%.2d:%.2d:%.2d %.2d-%.2d-%.2d]: ", lt->tm_hour, lt->tm_min,
-           lt->tm_sec, lt->tm_mday, (lt->tm_mon + 1), lt->tm_year);
+    fprintf(log, "[%d-%.2d-%.2d %.2d:%.2d:%.2d]: ",
+           lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
+           lt->tm_hour, lt->tm_min, lt->tm_sec);
     
     vfprintf(log, fmt, ap);
%0
>Audit-Trail:
>Unformatted:

Reply via email to