You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/11/03 05:26:54 UTC

[PATCH] suexec/1343: year-2000 bug in suexec log (fwd)

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 <eg...@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:



Re: [PATCH] suexec/1343: year-2000 bug in suexec log (fwd)

Posted by Dean Gaudet <dg...@arctic.org>.
My personal date preference is "YYYYMMDD hhmmss".  It sorts without doing
gymnastics to construct -k foobar for sort(1), and doesn't waste much
space. 

But at any rate, I'd rather just see suexec log in one of the other
formats we already use rather than create another new format.  So I'm
rescinding my +1. 

Dean

On Mon, 3 Nov 1997, Martin Kraemer wrote:

> On Sun, Nov 02, 1997 at 08:26:54PM -0800, Dean Gaudet wrote:
> > 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
> 
> Does the suexec error log appear in the regular error_log? If so, then
> shouldn't this change be made to aplog_error() as well? I mean, like
>   [1997/Nov/03 02:08:10] [notice] Apache/1.3b3-dev PHP/FI-2.0b12 configured -- resuming normal operations
> or
>   [1997-11-03 02:08:10] [notice] Apache/1.3b3-dev PHP/FI-2.0b12 configured -- resuming normal operations
> instead of the current
>   [Mon Nov  3 02:08:10 1997] [notice] Apache/1.3b3-dev PHP/FI-2.0b12 configured -- resuming normal operations
> ?
> 
>     Martin
> -- 
> | S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
> | ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
> | N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
> ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
> 


Re: [PATCH] suexec/1343: year-2000 bug in suexec log (fwd)

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Sun, Nov 02, 1997 at 08:26:54PM -0800, Dean Gaudet wrote:
> 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

Does the suexec error log appear in the regular error_log? If so, then
shouldn't this change be made to aplog_error() as well? I mean, like
  [1997/Nov/03 02:08:10] [notice] Apache/1.3b3-dev PHP/FI-2.0b12 configured -- resuming normal operations
or
  [1997-11-03 02:08:10] [notice] Apache/1.3b3-dev PHP/FI-2.0b12 configured -- resuming normal operations
instead of the current
  [Mon Nov  3 02:08:10 1997] [notice] Apache/1.3b3-dev PHP/FI-2.0b12 configured -- resuming normal operations
?

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request