Received: (qmail 21769 invoked by uid 2012); 31 Oct 1997 21:40:27 -0000 Message-Id: <19971031214027.21768.qmail@hyperreal.org> Date: 31 Oct 1997 21:40:27 -0000 From: Paul Eggert Reply-To: eggert@twinsun.com To: apbugs@hyperreal.org Subject: year-2000 bug in suexec log X-Send-Pr-Version: 3.2 >Number: 1343 >Category: suexec >Synopsis: year-2000 bug in suexec log >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Oct 31 13:50:00 PST 1997 >Last-Modified: Wed Jan 21 14:30:36 PST 1998 >Originator: eggert@twinsun.com >Organization: >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: State-Changed-From-To: open-analyzed State-Changed-By: dgaudet State-Changed-When: Wed Nov 5 03:27:40 PST 1997 State-Changed-Why: Yup this is a bug, but it'd be preferable for suexec to use one of the date formats already in use ... like the one in error_log or common log format (both are lame). Dean State-Changed-From-To: analyzed-closed State-Changed-By: dgaudet State-Changed-When: Wed Jan 21 14:30:36 PST 1998 State-Changed-Why: Fix committed to 1.3b4-dev. Thanks Dean >Unformatted: