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>
Thu, 28 May 2015 08:18:35 +0000 (17:18 +0900)
commitfe5c6edaed78839303d67e01e141cfc6b5de9aec
treeef3002eb63512f20f70bfc525f27d10873f9cc19
parent6cb18a8f975b7ff7ca79c1fb0cddcd4b66be90fb
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 dotlock_create.

--

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