httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] suexec/1343: year-2000 bug in suexec log (fwd)
Date Mon, 03 Nov 1997 04:26:54 GMT
I can't believe how many different ways we have of formatting dates. 

+1 on this change or any other change to suexec logging which fixes its
year 2000 problem. 

Dean

---------- Forwarded message ----------
Date: 31 Oct 1997 21:40:27 -0000
From: Paul Eggert <eggert@twinsun.com>
To: apbugs@hyperreal.org
Subject: suexec/1343: year-2000 bug in suexec log


>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:     eggert@twinsun.com
>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:



Mime
View raw message