summaryrefslogtreecommitdiff
path: root/backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-09-10 03:05:12 +0000
committerCoprDistGit <infra@openeuler.org>2023-09-10 03:05:12 +0000
commit2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 (patch)
treea2af4fd609c7decacbf0ea11926ea338596fb179 /backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch
parent0ae9f87336a3d78d8fbc0a1e5c75cba5f9cf8597 (diff)
automatic import of rpm
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
+