mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +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
|
@ -1401,7 +1401,7 @@ list_internal_keys (ctrl_t ctrl, strlist_t names, estream_t fp,
|
|||
|
||||
/* Suppress duplicates at least when they follow each other. */
|
||||
lastresname = NULL;
|
||||
while (!(rc = keydb_search (hd, desc, ndesc)))
|
||||
while (!(rc = keydb_search (ctrl, hd, desc, ndesc)))
|
||||
{
|
||||
unsigned int validity;
|
||||
|
||||
|
@ -1462,8 +1462,7 @@ list_internal_keys (ctrl_t ctrl, strlist_t names, estream_t fp,
|
|||
}
|
||||
}
|
||||
|
||||
if (!mode
|
||||
|| ((mode & 1) && !have_secret)
|
||||
if (!mode || ((mode & 1) && !have_secret)
|
||||
|| ((mode & 2) && have_secret) )
|
||||
{
|
||||
if (ctrl->with_colons)
|
||||
|
@ -1507,7 +1506,7 @@ list_external_cb (void *cb_value, ksba_cert_t cert)
|
|||
{
|
||||
struct list_external_parm_s *parm = cb_value;
|
||||
|
||||
if (keydb_store_cert (cert, 1, NULL))
|
||||
if (keydb_store_cert (parm->ctrl, cert, 1, NULL))
|
||||
log_error ("error storing certificate as ephemeral\n");
|
||||
|
||||
if (parm->print_header)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue