mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg,sm: Add STATUS_ERROR keydb_search and keydb_add-resource.
* g10/keydb.c (keydb_add_resource): Make ANY_REGISTERED file-global. Write a STATUS_ERROR. (maybe_create_keyring_or_box): Check for non-accessible but existant file. (keydb_search): Write a STATUS_ERROR if no keyring has been registered but continue to return NOT_FOUND. * sm/keydb.c (keydb_add_resource): Rename ANY_PUBLIC to ANY_REGISTERED and make file-global. Write a STATUS_ERROR. (keydb_search): Write a STATUS_ERROR if no keyring has been registered but continue to return NOT_FOUND. Also add new arg CTRL and change all callers to pass it down. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
c8044c6e33
commit
5d13581f47
17 changed files with 163 additions and 99 deletions
|
@ -72,7 +72,7 @@ delete_one (ctrl_t ctrl, const char *username)
|
|||
keydb_set_ephemeral (kh, 1);
|
||||
}
|
||||
|
||||
rc = keydb_search (kh, &desc, 1);
|
||||
rc = keydb_search (ctrl, kh, &desc, 1);
|
||||
if (!rc)
|
||||
rc = keydb_get_cert (kh, &cert);
|
||||
if (!rc && !is_ephem)
|
||||
|
@ -82,7 +82,7 @@ delete_one (ctrl_t ctrl, const char *username)
|
|||
gpgsm_get_fingerprint (cert, 0, fpr, NULL);
|
||||
|
||||
next_ambigious:
|
||||
rc = keydb_search (kh, &desc, 1);
|
||||
rc = keydb_search (ctrl, kh, &desc, 1);
|
||||
if (rc == -1)
|
||||
rc = 0;
|
||||
else if (!rc)
|
||||
|
@ -126,7 +126,7 @@ delete_one (ctrl_t ctrl, const char *username)
|
|||
do
|
||||
{
|
||||
keydb_search_reset (kh);
|
||||
rc = keydb_search (kh, &desc, 1);
|
||||
rc = keydb_search (ctrl, kh, &desc, 1);
|
||||
if (rc)
|
||||
{
|
||||
log_error ("problem re-searching certificate: %s\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue