diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2022-05-30 14:24:45 +0300 |
---|---|---|
committer | Michal Domonkos <mdomonko@redhat.com> | 2022-07-01 10:52:14 +0200 |
commit | f4d86a744016890e3a08e9e50616ff4cbae41333 (patch) | |
tree | b8e99aa0e52a80e7367d98e76b02af14256b4cdc | |
parent | 2f83c32a086e4a9ab8575c79010d4024d73b03cf (diff) | |
download | rpm-f4d86a744016890e3a08e9e50616ff4cbae41333.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.c | 1 |
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; |