[git] GPGME - branch, master, updated. gpgme-1.7.1-28-g2a39bd6

by Werner Koch cvs at cvs.gnupg.org
Thu Nov 10 17:19:23 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  2a39bd6c30d21c43c86645a7908ce6c57dad5e20 (commit)
      from  d0030efb45ec8436dd84a9623d2f66b80c6b9e10 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2a39bd6c30d21c43c86645a7908ce6c57dad5e20
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Nov 10 17:13:02 2016 +0100

    core: Detect unreadable keyrings.
    
    * src/keylist.c (op_data_t): Add field keydb_search_err.
    (keylist_status_handler): Parse STATUS_ERROR into that var.
    (gpgme_op_keylist_next): Use that err instead of GPG_ERR_EOF.
    --
    
    With a recent GnuPG version this allows to detect a keyring with wrong
    permissions (i.e. no read access).  GPG_ERR_OPEN_KEYRING will be
    returned instead of GPG_ERR_EOF.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/keylist.c b/src/keylist.c
index 8a0c5a3..6e22e16 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -54,6 +54,9 @@ typedef struct
 {
   struct _gpgme_op_keylist_result result;
 
+  /* The error code from ERROR keydb_search. */
+  gpgme_error_t keydb_search_err;
+
   gpgme_key_t tmp_key;
 
   /* This points to the last uid in tmp_key.  */
@@ -135,10 +138,17 @@ keylist_status_handler (void *priv, gpgme_status_code_t code, char *args)
       opd->result.truncated = 1;
       break;
 
+    case GPGME_STATUS_ERROR:
+      err = _gpgme_parse_failure (args);
+      if (!opd->keydb_search_err && !strcmp (args, "keydb_search"))
+        opd->keydb_search_err = err;
+      err = 0;
+      break;
+
     default:
       break;
     }
-  return 0;
+  return err;
 }
 
 

@@ -1138,7 +1148,8 @@ gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key)
 	return TRACE_ERR (err);
 
       if (!opd->key_cond)
-	return TRACE_ERR (gpg_error (GPG_ERR_EOF));
+	return TRACE_ERR (opd->keydb_search_err? opd->keydb_search_err
+                          /**/                 : gpg_error (GPG_ERR_EOF));
 
       opd->key_cond = 0;
       assert (opd->key_queue);

-----------------------------------------------------------------------

Summary of changes:
 src/keylist.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list