public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/30710] New: tzset doesn't fallback to UTC if TZ asked by the user is not installed
@ 2023-07-31 22:46 romain.naour at gmail dot com
  2023-07-31 22:46 ` [Bug time/30710] " sam at gentoo dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: romain.naour at gmail dot com @ 2023-07-31 22:46 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=30710

            Bug ID: 30710
           Summary: tzset doesn't fallback to UTC if TZ asked by the user
                    is not installed
           Product: glibc
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: romain.naour at gmail dot com
  Target Milestone: ---

Hello,

I recently switched from a uClibc-ng toolchain to a glibc toolchain with the
following test case:

Test1:
TZ=UTC date +%Z
UTC

OK

Test2:
# Default to UTC if TZ requested is missing.
TZ=America/Los_Angeles date +%Z
America

KO

"America" is returned while "UTC" is expected here (checked with uClibc-ng and
musl)

(On the tested rootfs TZDIR "/usr/share/zoneinfo" doesn't exist)

Test3:
TZ=plop date +%Z
plop

KO

Actually %Z return all or part of TZ content on any Linux OS using glibc.

Why glibc's tzset_internal() try to do something else than using UTC, when no
data file is found and the user set TZ with a random string (not even a POSIX
timezone specification in the form
stdoffset[dst[offset][,start[/time],end[/time]]) ?

https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzset.c;h=78c18f8147415c92dc6eb735be672fa7e0b8f76e;hb=78ca34d8c55eee6b0664f9c1d30fcca71077b843#l409

Reported by Buildroot gitlab-ci:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561117

Best regards,
Romain

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-01  6:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 22:46 [Bug time/30710] New: tzset doesn't fallback to UTC if TZ asked by the user is not installed romain.naour at gmail dot com
2023-07-31 22:46 ` [Bug time/30710] " sam at gentoo dot org
2023-07-31 23:20 ` romain.naour at gmail dot com
2023-08-01  6:45 ` schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).