Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 25 Apr 2021 19:46:51 +0200
From: Sören Tempel <>
Subject: Handling of non-location specific TZ values


While debugging a test failure of the calendar application calcurse on
Alpine I noticed that musl does not support TZ values which don't
include area/location information, e.g. TZ=CET [0]. This is contrary to
the documentation from the musl wiki which states the following [1]:

	The zoneinfo file is interpreted as an absolute pathname if it
	begins with a slash, a relative pathname if it begins with a
	dot, and otherwise is searched in /usr/share/zoneinfo,
	/share/zoneinfo, and /etc/zoneinfo.

Since commit 5c4f11d995cf178b3146cde0734d6988c145f243 musl only consults
the zoneinfo database if the value of the TZ environment variable starts
with a colon or contains a slash [2]. As such, the zoneinfo database is
not consulted for TZ=CET thereby causing musl to not determine DST etc.
correctly for such TZ values. TZ values such as Europe/Kaliningrad are
correctly looked up in the zoneinfo database though.

The aforementioned commit claims that this strict check is necessary
since "TZ=name is reserved for POSIX-form" which consists of a mandatory
timezone name (std), an offset, and some more optional information [3].
**If** TZ values adhering to the POSIX format should not be looked up in
the zoneinfo database, it would be necessary to somehow determine if a
given string adheres to the POSIX timezone format before performing the

The glibc implementation seems to unconditionally consult the zoneinfo
database and falls back to the POSIX format (__tzset_parse_tz) if no
corresponding file was found in the database [4]. Apart from glibc, the
non-POSIX TZ format with TZ=<timezone> is also supported BSDs, e.g.
OpenBSD [5].

Any thoughts on how this could fixed in musl?



Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.