aboutsummaryrefslogtreecommitdiffstats
path: root/sm/keydb.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-08-23 13:51:13 +0000
committerWerner Koch <[email protected]>2019-08-23 13:51:43 +0000
commite64f0dfd72de548837f630bccd249a87451b89c5 (patch)
tree55c282ab9ea9ad9b210a3c38981986ec37bb749c /sm/keydb.c
parentkbx: Include deleted records into the --stats output. (diff)
downloadgnupg-e64f0dfd72de548837f630bccd249a87451b89c5.tar.gz
gnupg-e64f0dfd72de548837f630bccd249a87451b89c5.zip
gpg,sm: Implement keybox compression run and release lock in gpgsm
* g10/keydb.c (keydb_add_resource): Call keybox_compress. * sm/keydb.c (keydb_add_resource): Release the lock after a compress. -- Note that in gpgsm we already did the compress run but we didn't released the lock on the file. This might have been a reason for some strange hangs. GnuPG-bug-id: 4644 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'sm/keydb.c')
-rw-r--r--sm/keydb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sm/keydb.c b/sm/keydb.c
index 53e3cf887..16ed85be5 100644
--- a/sm/keydb.c
+++ b/sm/keydb.c
@@ -362,7 +362,10 @@ keydb_add_resource (ctrl_t ctrl, const char *url, int force, int *auto_created)
if (kbxhd)
{
if (!keybox_lock (kbxhd, 1, 0))
- keybox_compress (kbxhd);
+ {
+ keybox_compress (kbxhd);
+ keybox_lock (kbxhd, 0, 0);
+ }
keybox_release (kbxhd);
}