Subject: pkg/14581: timezone handling bug in cronolog package
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@azeotrope.org>
List: netbsd-bugs
Date: 11/13/2001 22:15:57
>Number:         14581
>Category:       pkg
>Synopsis:       timezone handling bug in cronolog package
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 13 20:17:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dave Huang
>Release:        NetBSD 1.5Y
>Organization:
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym@azeotrope.org |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 26 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Environment:
	
	
System: NetBSD yerfable.azeotrope.org 1.5Y NetBSD 1.5Y (YERFABLE) #182: Sat Nov 3 03:42:35 CST 2001 khym@yerfable.azeotrope.org:/usr/src.local/sys/arch/alpha/compile/YERFABLE alpha
Architecture: alpha
Machine: alpha
>Description:
	cronolog uses localtime_r(), but never calls tzset() to
initialize the timezone info. As a result, one line goes into an
incorrectly-named logfile (it later calls localtime(), which
initializes the TZ info).
>How-To-Repeat:
	Use cronolog with the timezone set to Central Time. If the
format string is log.%Y%U, for example, notice that a logfile named
log.200144 is created, even though date +"%Y%U" shows 200145.
>Fix:
Add this file as patch-ab

--- cronolog.c.orig	Tue Nov 13 22:02:01 2001
+++ cronolog.c	Tue Nov 13 22:02:16 2001
@@ -242,6 +242,7 @@
 
     DEBUG(("periodicity = %s\n", periods[periodicity]));
 
+    tzset();
 
     /* Loop, waiting for data on standard input */
 
>Release-Note:
>Audit-Trail:
>Unformatted: