summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-05-30 14:24:45 +0300
committerPanu Matilainen <pmatilai@redhat.com>2022-06-28 14:51:02 +0300
commit2e2c93d392e850a7b1b6a609053c43ace5e45053 (patch)
tree87949d20e51eb09088b678f6332eea630c868eb4
parent6f945960affc7a2a2b49337458457273d8a4faf5 (diff)
downloadrpm-2e2c93d392e850a7b1b6a609053c43ace5e45053.tar.gz
Fix changelog parsing affecting caller timezone state
We meddle with TZ environ which then propagates to other values through mktime() implicitly calling tzset(), but that other data doesn't get reset by just restoring the TZ variable. Restore initial state by explicitly call tzset() after we're done with it. Fixes: #1821 (cherry picked from commit 1a7de551a74d73f01eb40cb744c1dbba5faeb651)
-rw-r--r--build/parseChangelog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index 65c0952a6..c59786f25 100644
--- a/build/parseChangelog.c
+++ b/build/parseChangelog.c
@@ -175,6 +175,7 @@ static int dateToTimet(const char * datestr, time_t * secs, int * date_words)
setenv("TZ", tz, 1);
free(tz);
}
+ tzset();
if (*secs == -1) goto exit;