aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2025-10-22 01:46:20 +0000
committerNIIBE Yutaka <[email protected]>2025-10-22 01:46:20 +0000
commitef42a1e218ce5ba26723e5af0ba16fe0ce7d4b00 (patch)
tree1063e6cd2b06eed4be98b212f6f4ba52822d8ce3
parentkbx,gpg,gpgsm: Introduce keybox_compress_when_no_other_users. (diff)
downloadgnupg-ef42a1e218ce5ba26723e5af0ba16fe0ce7d4b00.tar.gz
gnupg-ef42a1e218ce5ba26723e5af0ba16fe0ce7d4b00.zip
gpg,gpgsm: No more internal-lock when KEEP_LOCK is enabled.
* g10/keydb.c (lock_all): Success when KEEP_LOCK already. * sm/keydb.c (lock_all): Ditto. -- GnuPG-bug-id: 7855 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--g10/keydb.c3
-rw-r--r--sm/keydb.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/g10/keydb.c b/g10/keydb.c
index 3d95f511a..06c78f048 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -1012,6 +1012,9 @@ lock_all (KEYDB_HANDLE hd)
To fix this we need to use a lock file to protect lock_all. */
+ if (hd->keep_lock)
+ return 0;
+
for (i=0; !rc && i < hd->used; i++)
{
switch (hd->active[i].type)
diff --git a/sm/keydb.c b/sm/keydb.c
index 651bbd968..68325113a 100644
--- a/sm/keydb.c
+++ b/sm/keydb.c
@@ -811,6 +811,9 @@ lock_all (KEYDB_HANDLE hd)
if (hd->use_keyboxd)
return 0;
+ if (hd->keep_lock)
+ return 0;
+
/* Fixme: This locking scheme may lead to deadlock if the resources
are not added in the same order by all processes. We are
currently only allowing one resource so it is not a problem. */