Home GnuPG
Diffusion GnuPG 7962eca3a023

gpgsm: Change delete and store certificate locking glitches.

Description

gpgsm: Change delete and store certificate locking glitches.

* sm/keydb.c (keydb_store_cert): Unlock before locking the pubring.
(keydb_insert_cert): Rename to ...
(do_insert_cert): this.  Do not unlock.  The caller keydb_store_cert
does the unlock anyway by means of keydb_release.
(keydb_delete): Remove the unlock arg.  We do not need it ...
* sm/delete.c (delete_one): ... because a keydb_release is anyway
called.

Note that we need to release the lock afterclosing the file and not
earlier. Otehrwise other processes may get the file lock but can't
open the file and rename it because the Close of the first process has
not yet suceeded.

This is a Windows problem. Cheers for the inode concept of Unix.

Details