From 5582c2015e2659a990528fd6b033ea2b848873dc Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Thu, 21 Dec 2023 09:12:14 +0100 Subject: [PATCH] Use `TZDIR` as override lookup path The TZDIR environment variable override the lookup paths and does not append them. This patch fixes that behavior and is a follow-up on: https://github.com/containers/common/pull/1772 Ref: https://github.com/containers/podman/pull/21063#discussion_r1432809463 Signed-off-by: Sascha Grunert --- pkg/config/config_local.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/config_local.go b/pkg/config/config_local.go index bcee683d6..5ae543dfb 100644 --- a/pkg/config/config_local.go +++ b/pkg/config/config_local.go @@ -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 {