g10: Fix a race condition initially creating trustdb.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 28 May 2015 08:08:37 +0000 (17:08 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 15 Jun 2015 05:26:56 +0000 (14:26 +0900)
commit2371553af156b5f8d6282e42cb8891f0c986d3d3
treed36a74b74ca946701e4286f9cb921065a4fa8d4a
parentc30bcdeac0112680a61819c52ab90beb69fdc6c0
g10: Fix a race condition initially creating trustdb.

* g10/tdbio.c (take_write_lock, release_write_lock): New.
(put_record_into_cache, tdbio_sync, tdbio_end_transaction): Use
new lock functions.
(tdbio_set_dbname): Fix the race.
(open_db): Don't call create_dotlock.

--

(backported from commit fe5c6edaed78839303d67e01e141cfc6b5de9aec)

GnuPG-bug-id: 1675
g10/tdbio.c