Skip to content

Commit

Permalink
Use TZDIR as override lookup path
Browse files Browse the repository at this point in the history
The TZDIR environment variable override the lookup paths and does not
append them. This patch fixes that behavior and is a follow-up on:

containers#1772

Ref: containers/podman#21063 (comment)

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
  • Loading branch information
saschagrunert committed Dec 21, 2023
1 parent 4d7586e commit 72dd51e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/config/config_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func (c *ContainersConfig) validateTZ() error {
"/etc/zoneinfo",
}

// Allow using TZDIR per:
// Allow using TZDIR to ovverride the lookupPaths. Ref:
// https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzfile.c;h=8a923d0cccc927a106dc3e3c641be310893bab4e;hb=HEAD#l149
tzdir := os.Getenv("TZDIR")
if tzdir != "" {
lookupPaths = append(lookupPaths, tzdir)
lookupPaths = []string{tzdir}
}

for _, paths := range lookupPaths {
Expand Down

0 comments on commit 72dd51e

Please sign in to comment.