summaryrefslogtreecommitdiff
path: root/backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch')
-rw-r--r--backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch b/backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch
new file mode 100644
index 0000000..4b236e8
--- /dev/null
+++ b/backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch
@@ -0,0 +1,30 @@
+From 1a7de551a74d73f01eb40cb744c1dbba5faeb651 Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Mon, 30 May 2022 14:24:45 +0300
+Subject: [PATCH] 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
+---
+ build/parseChangelog.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build/parseChangelog.c b/build/parseChangelog.c
+index 65c0952..c59786f 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;
+
+--
+1.8.3.1
+