g10: Fix a race condition initially creating trustdb.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 15 Jun 2015 05:38:05 +0000 (14:38 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 15 Jun 2015 05:38:05 +0000 (14:38 +0900)
commit6f992d94ea708535b2f3a3de22b429401d59fac9
tree71aa2b1afdc3bb7f9ca07c8631b5bc3377e9c3cd
parentf3b00d88efa25e23f70b757cf99302af77d3d7ae
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.

--

(backported from 2.1 commit fe5c6edaed78839303d67e01e141cfc6b5de9aec)
GnuPG-bug-id: 1675
g10/tdbio.c