diff options
| author | NIIBE Yutaka <[email protected]> | 2025-10-22 01:52:52 +0000 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2025-10-22 01:52:52 +0000 |
| commit | 4a2dda2002c42fa541dacd142093c89476df606d (patch) | |
| tree | 2d16bc08c7bf4135536e5ae1fb8c33bb5fa66b94 /kbx/keybox-init.c | |
| parent | gpg,gpgsm: No more internal-lock when KEEP_LOCK is enabled. (diff) | |
| download | gnupg-4a2dda2002c42fa541dacd142093c89476df606d.tar.gz gnupg-4a2dda2002c42fa541dacd142093c89476df606d.zip | |
kbx,gpg,gpgsm: Add FP-close method for keydb to close before unlock.
* kbx/keybox.h (keybox_fp_close): New.
* kbx/keybox-init.c (keybox_fp_close): New.
(keybox_release): Don't close FP here.
* kbx/keybox-update.c (keybox_compress_when_no_other_users): Use
keybox_fp_close.
* kbx/backend-kbx.c (be_kbx_release_kbx_hd): Follow the change.
* g10/keyring.h (keyring_fp_close): New.
* g10/keyring.c (keyring_fp_close): New.
(keyring_release): Don't close IOBUF here.
(keyring_rebuild_cache): Use keyring_fp_close.
* g10/keydb.c (do_fp_close): New.
(unlock_all): Close FP before unlocking.
* sm/keydb.c (do_fp_close): New.
(unlock_all): Close FP before unlocking.
--
GnuPG-bug-id: 7855
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'kbx/keybox-init.c')
| -rw-r--r-- | kbx/keybox-init.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/kbx/keybox-init.c b/kbx/keybox-init.c index 53c716833..47b44909e 100644 --- a/kbx/keybox-init.c +++ b/kbx/keybox-init.c @@ -193,6 +193,18 @@ keybox_new_x509 (void *token, int secret) void +keybox_fp_close (KEYBOX_HANDLE hd) +{ + if (!hd) + return; + if (hd->fp) + { + _keybox_ll_close (hd->fp); + hd->fp = NULL; + } +} + +void keybox_release (KEYBOX_HANDLE hd) { if (!hd) @@ -206,11 +218,6 @@ keybox_release (KEYBOX_HANDLE hd) } _keybox_release_blob (hd->found.blob); _keybox_release_blob (hd->saved_found.blob); - if (hd->fp) - { - _keybox_ll_close (hd->fp); - hd->fp = NULL; - } xfree (hd->word_match.name); xfree (hd->word_match.pattern); xfree (hd); |
