1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

sm: On Windows close the kbx files at several places.

* kbx/keybox-search.c (keybox_search_reset) [W32]: Always close.

* kbx/keybox-init.c (keybox_close_all_files): New.
* sm/keydb.c (keydb_close_all_files): New.
* sm/call-dirmngr.c (gpgsm_dirmngr_isvalid): Call new function.
(gpgsm_dirmngr_lookup): Ditto.
(gpgsm_dirmngr_run_command): Ditto.
--

We need to make sure that there are no open files on Windows.  Thus we
close them at several strategic locations.

GnuPG-bug-id: 4505
This commit is contained in:
Werner Koch 2021-03-02 19:01:07 +01:00
parent c99f3599d8
commit 2b9ae79ad8
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
6 changed files with 56 additions and 1 deletions

View file

@ -505,6 +505,8 @@ gpgsm_dirmngr_isvalid (ctrl_t ctrl,
struct inq_certificate_parm_s parm;
struct isvalid_status_parm_s stparm;
keydb_close_all_files ();
rc = start_dirmngr (ctrl);
if (rc)
return rc;
@ -775,6 +777,8 @@ gpgsm_dirmngr_lookup (ctrl_t ctrl, strlist_t names, const char *uri,
if ((names && uri) || (!names && !uri))
return gpg_error (GPG_ERR_INV_ARG);
keydb_close_all_files ();
/* The lookup function can be invoked from the callback of a lookup
function, for example to walk the chain. */
if (!dirmngr_ctx_locked)
@ -1043,6 +1047,8 @@ gpgsm_dirmngr_run_command (ctrl_t ctrl, const char *command,
size_t len;
struct run_command_parm_s parm;
keydb_close_all_files ();
rc = start_dirmngr (ctrl);
if (rc)
return rc;