[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: timezone variable not set correctly, bug blocking LSB Conformance



tag 375978 + sarge
thanks


Hi SRM team!

Would such a fix to the glibc be accepted for a stable release?

Bye,
Aurelien


Martin Dittmar wrote:
Package: libc6
Version: 2.3.2.ds1-22sarge3

Problem: after calling the C method "ctime" the global variable "timezone" is not set correctly with certain TZ environment variables. With TZ=JKL3:10PNM4:40 set, the value of "timezone" is expected to be 11400, but has a nonsense value of 18000.

For a demonstration please see the attched file test.c

This is a libc bug (already in libc Bugzilla (see http://sourceware.org/bugzilla/show_bug.cgi?id=2865 )), but can be fixed in Debian.

This would be important for LSB compliance (LSB Runtime tests LSB runtime tests T.ctime_X 1, T.localtim_X 1, T.mktime_X 1).
LSB test failure message:
       with TZ=JKL3:10PNM4:40 ctime() did not set timezone correctly
       value of timezone was 18000, expected 11400

A patch for sarge is attached.

Kernel on tested system: 2.6.14-2-686-smp
libc version: 2.3.2.ds1-22sarge3



------------------------------------------------------------------------

#! /bin/sh -e

# DP: Make __tzfile_default reset __use_tzfile = 0 before returning to tzset_internal

if [ $# -ne 2 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

--- glibc-2.3.2/time/tzfile.c.dist	2006-06-23 17:32:49.946051496 +0200
+++ glibc-2.3.2/time/tzfile.c	2006-06-23 17:36:12.606973832 +0200
@@ -439,6 +439,10 @@
   /* Set the timezone.  */
   __timezone = -types[0].offset;
+ /* since the user specified a hand-made timezone we dont claim to
+   * use tzfile further on */
+  __use_tzfile = 0;
+
   compute_tzname_max (stdlen + dstlen);
 }
 

--
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net



Reply to: