public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/114645] New: std::chrono::current_zone ignores $TZ on Linux
@ 2024-04-08 19:01 hristo at venev dot name
  2024-04-08 19:27 ` [Bug libstdc++/114645] " redi at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: hristo at venev dot name @ 2024-04-08 19:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114645

            Bug ID: 114645
           Summary: std::chrono::current_zone ignores $TZ on Linux
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hristo at venev dot name
  Target Milestone: ---

On all platforms, glibc first checks $TZ, and only defaults to `/etc/localtime`
if it isn't set. Empty $TZ means UTC. One starting `:` is removed.

glibc interprets $TZ as a path, which is resolved relative to
${TZDIR:-default_tzdir}.

(if __libc_enable_secure is set, some checks are made to $TZ to prevent reading
of arbitrary files. In particular, it must not contain "../", and if absolute,
must either be "/etc/localtime" or must start with the default $TZDIR)

Some more details:

https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzset.c;hb=ae7468a7b0bcf22e9cd5fcae42bb9e4f65de83ee#l365

https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzfile.c;hb=ae7468a7b0bcf22e9cd5fcae42bb9e4f65de83ee#l105

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

end of thread, other threads:[~2024-04-10  1:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 19:01 [Bug libstdc++/114645] New: std::chrono::current_zone ignores $TZ on Linux hristo at venev dot name
2024-04-08 19:27 ` [Bug libstdc++/114645] " redi at gcc dot gnu.org
2024-04-08 20:23 ` hristo at venev dot name
2024-04-08 20:25 ` redi at gcc dot gnu.org
2024-04-08 20:46 ` hristo at venev dot name
2024-04-08 20:48 ` redi at gcc dot gnu.org
2024-04-08 20:51 ` redi at gcc dot gnu.org
2024-04-08 20:56 ` hristo at venev dot name
2024-04-09  9:19 ` redi at gcc dot gnu.org
2024-04-09  9:41 ` hristo at venev dot name
2024-04-09  9:46 ` xry111 at gcc dot gnu.org
2024-04-09  9:49 ` hristo at venev dot name
2024-04-09 16:40 ` redi at gcc dot gnu.org
2024-04-09 17:19 ` hristo at venev dot name
2024-04-09 23:29 ` harald at gigawatt dot nl
2024-04-09 23:29 ` redi at gcc dot gnu.org
2024-04-09 23:43 ` redi at gcc dot gnu.org
2024-04-09 23:47 ` redi at gcc dot gnu.org
2024-04-09 23:50 ` harald at gigawatt dot nl
2024-04-09 23:57 ` redi at gcc dot gnu.org
2024-04-10  0:07 ` redi at gcc dot gnu.org
2024-04-10  0:26 ` harald at gigawatt dot nl
2024-04-10  0:57 ` redi at gcc dot gnu.org
2024-04-10  1:10 ` redi at gcc dot gnu.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).