mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-24 22:09:57 +01:00
sm: Lock kbx files also before a search.
* sm/keydb.c (keydb_search): Lock files. -- This is required for Windows to avoid update locks. We use it also on Unix so that the locking behaviour is more or less indentical. GnuPG-bug-id: 4505
This commit is contained in:
parent
2b9ae79ad8
commit
677245ba0e
@ -931,7 +931,7 @@ int
|
||||
keydb_search (ctrl_t ctrl, KEYDB_HANDLE hd,
|
||||
KEYDB_SEARCH_DESC *desc, size_t ndesc)
|
||||
{
|
||||
int rc = -1;
|
||||
int rc;
|
||||
unsigned long skipped;
|
||||
|
||||
if (!hd)
|
||||
@ -944,6 +944,11 @@ keydb_search (ctrl_t ctrl, KEYDB_HANDLE hd,
|
||||
return gpg_error (GPG_ERR_NOT_FOUND);
|
||||
}
|
||||
|
||||
rc = keydb_lock (hd);
|
||||
if (rc)
|
||||
return rc;
|
||||
rc = -1;
|
||||
|
||||
while (rc == -1 && hd->current >= 0 && hd->current < hd->used)
|
||||
{
|
||||
switch (hd->active[hd->current].type)
|
||||
|
Loading…
x
Reference in New Issue
Block a user