aboutsummaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-06-13 07:05:40 +0000
committerWerner Koch <[email protected]>2017-06-13 07:05:40 +0000
commite80925171ddb20c7e76c1db88c15ce2d9b09db86 (patch)
tree9b7ce23d46def287ee3b36df081d3d60e2a44c8c /g10/getkey.c
parentpo: Make a string translatable. (diff)
downloadgnupg-e80925171ddb20c7e76c1db88c15ce2d9b09db86.tar.gz
gnupg-e80925171ddb20c7e76c1db88c15ce2d9b09db86.zip
gpg: Disable keydb handle caching only for W32
* g10/getkey.c (getkey_end) [!W32]: Re-enable caching. -- This change limits of the effects of commit d3d640b9cc98dd0d06b49a2e4d46eb67af96fe29 to W32 system. GnuPG-bug-id: 3097 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index ac6b9a307..a3df8578a 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -2219,20 +2219,27 @@ getkey_end (ctrl_t ctrl, getkey_ctx_t ctx)
{
if (ctx)
{
-/*
-XXX: This creates a big regression for Windows because the keyring
-* is only released after the global ctrl is released. So if an operation
-* does a getkey and then tries to modify the keyring it will fail on
-* Windows with a sharing violation. We need to modify all
-* keyring write operations to also take the ctrl and close the
-* cached_getkey_kdb handle to make writing work. See:
-* https://dev.gnupg.org/T3097
+#ifdef HAVE_W32_SYSTEM
+
+ /* FIXME: This creates a big regression for Windows because the
+ * keyring is only released after the global ctrl is released.
+ * So if an operation does a getkey and then tries to modify the
+ * keyring it will fail on Windows with a sharing violation. We
+ * need to modify all keyring write operations to also take the
+ * ctrl and close the cached_getkey_kdb handle to make writing
+ * work. See: GnuPG-bug-id: 3097 */
+ (void)ctrl;
+ keydb_release (ctx->kr_handle);
+
+#else /*!HAVE_W32_SYSTEM*/
if (ctrl && !ctrl->cached_getkey_kdb)
ctrl->cached_getkey_kdb = ctx->kr_handle;
else
-*/
- keydb_release (ctx->kr_handle);
+ keydb_release (ctx->kr_handle);
+
+#endif /*!HAVE_W32_SYSTEM*/
+
free_strlist (ctx->extra_list);
if (!ctx->not_allocated)
xfree (ctx);