From 6f72aa821407e47ad3963e72e139f2ca2c69d9dd Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 14 May 2019 19:05:58 +0200 Subject: 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 --- kbx/keybox-update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kbx/keybox-update.c') diff --git a/kbx/keybox-update.c b/kbx/keybox-update.c index 580330f52..e09fefc41 100644 --- a/kbx/keybox-update.c +++ b/kbx/keybox-update.c @@ -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); -- cgit v1.2.3