[Pkg-gnupg-commit] [gnupg2] 99/102: import upstream patch
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Fri Jun 17 00:15:06 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit 473b45431bf898f822d2e7f9893705e585fbc6ba
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Thu Jun 16 18:29:57 2016 -0400
import upstream patch
---
...another-race-condition-for-trustdb-access.patch | 53 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 54 insertions(+)
diff --git a/debian/patches/0003-g10-Fix-another-race-condition-for-trustdb-access.patch b/debian/patches/0003-g10-Fix-another-race-condition-for-trustdb-access.patch
new file mode 100644
index 0000000..05dc4f8
--- /dev/null
+++ b/debian/patches/0003-g10-Fix-another-race-condition-for-trustdb-access.patch
@@ -0,0 +1,53 @@
+From: Niibe Yutaka <gniibe at fsij.org>
+Date: Wed, 15 Jun 2016 08:41:56 +0900
+Subject: g10: Fix another race condition for trustdb access.
+
+* g10/tdbio.c (create_version_record): Call create_hashtable to always
+make hashtable, together with the version record.
+(get_trusthashrec): Remove call to create_hashtable.
+
+--
+
+GnuPG-bug-id: 1675
+Thanks to Scott Moser for a reproducible script and patience.
+
+Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
+---
+ g10/tdbio.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/g10/tdbio.c b/g10/tdbio.c
+index a414709..e27788e 100644
+--- a/g10/tdbio.c
++++ b/g10/tdbio.c
+@@ -119,6 +119,7 @@ static int in_transaction;
+
+
+ static void open_db (void);
++static void create_hashtable (TRUSTREC *vr, int type);
+
+
+
+@@ -582,8 +583,13 @@ create_version_record (void)
+ rec.rectype = RECTYPE_VER;
+ rec.recnum = 0;
+ rc = tdbio_write_record (&rec);
++
+ if (!rc)
+ tdbio_sync ();
++
++ if (!rc)
++ create_hashtable (&rec, 0);
++
+ return rc;
+ }
+
+@@ -957,8 +963,6 @@ get_trusthashrec(void)
+ if (rc)
+ log_fatal (_("%s: error reading version record: %s\n"),
+ db_name, gpg_strerror (rc) );
+- if (!vr.r.ver.trusthashtbl)
+- create_hashtable (&vr, 0);
+
+ trusthashtbl = vr.r.ver.trusthashtbl;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 160913f..36806e3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-avoid-beta-warning.patch
0002-Avoid-simple-memory-dumps-via-ptrace.patch
+0003-g10-Fix-another-race-condition-for-trustdb-access.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list