1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

kbx: Fix deadlock in gpgsm on Windows due to a sharing violation.

* kbx/keybox-init.c (keybox_lock) [W32]: Use _keybox_close_file
instead of fclose so that a close is done if the file is opened by
another handle.
* kbx/keybox-search.c (keybox_search): Remember the last offset and
use that in NEXT search mode if we had to re-open the file.
--

GnuPG-bug-id: 4505
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-05-14 19:05:58 +02:00
parent 22e274f839
commit 49b236af0e
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 42 additions and 14 deletions

View file

@ -423,7 +423,7 @@ keybox_update_keyblock (KEYBOX_HANDLE hd, const void *image, size_t imagelen)
if (off == (off_t)-1)
return gpg_error (GPG_ERR_GENERAL);
/* Close this the file so that we do no mess up the position for a
/* Close the file so that we do no mess up the position for a
next search. */
_keybox_close_file (hd);