[git] GnuPG - branch, master, updated. gnupg-2.1.21-3-ga8dd968

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed May 17 02:52:09 CEST 2017


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  a8dd96826f8484c0ae93c954035b95c2a75c80f2 (commit)
      from  386a7bbb245dd3ab7c4156a554adbe75d82bdf49 (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 a8dd96826f8484c0ae93c954035b95c2a75c80f2
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed May 17 09:46:06 2017 +0900

    g10: Suppress error for card availability check.
    
    * g10/call-agent.c (start_agent): Add semantics for card; Suppress
    error for card check.
    (warn_version_mismatch): Ignore an error for scdaemon.
    (agent_scd_serialno): Call start_agent with
    FLAG_FOR_CARD_SUPPRESS_ERRORS.
    
    --
    
    GnuPG-bug-id: 3165
    Fixes-commit: 97a2394ecafaa6f58e4a1f70ecfd04408dc15606
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/call-agent.c b/g10/call-agent.c
index be8c33d..4698a25 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -184,7 +184,8 @@ default_inq_cb (void *opaque, const char *line)
 
 
 /* Print a warning if the server's version number is less than our
-   version number.  Returns an error code on a connection problem.  */
+   version number.  Returns an error code on a connection problem.
+   Ignore an error for scdaemon (MODE==2).  */
 static gpg_error_t
 warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
 {
@@ -193,7 +194,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
   const char *myversion = strusage (13);
 
   err = get_assuan_server_version (ctx, mode, &serverversion);
-  if (err)
+  if (err && mode != 2)
     log_error (_("error getting version from '%s': %s\n"),
                servername, gpg_strerror (err));
   else if (compare_version_strings (serverversion, myversion) < 0)
@@ -217,10 +218,12 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
 }
 
 
+#define FLAG_FOR_CARD_SUPPRESS_ERRORS 2
+
 /* Try to connect to the agent via socket or fork it off and work by
    pipes.  Handle the server's initial greeting */
 static int
-start_agent (ctrl_t ctrl, int for_card)
+start_agent (ctrl_t ctrl, int flag_for_card)
 {
   int rc;
 
@@ -280,7 +283,7 @@ start_agent (ctrl_t ctrl, int for_card)
         }
     }
 
-  if (!rc && for_card && !did_early_card_test)
+  if (!rc && flag_for_card && !did_early_card_test)
     {
       /* Request the serial number of the card for an early test.  */
       struct agent_card_info_s info;
@@ -292,7 +295,7 @@ start_agent (ctrl_t ctrl, int for_card)
         rc = assuan_transact (agent_ctx, "SCD SERIALNO openpgp",
                               NULL, NULL, NULL, NULL,
                               learn_status_cb, &info);
-      if (rc)
+      if (rc && !(flag_for_card & FLAG_FOR_CARD_SUPPRESS_ERRORS))
         {
           switch (gpg_err_code (rc))
             {
@@ -1023,7 +1026,7 @@ agent_scd_serialno (char **r_serialno, const char *demand)
   char *serialno = NULL;
   char line[ASSUAN_LINELENGTH];
 
-  err = start_agent (NULL, 1);
+  err = start_agent (NULL, 1 | FLAG_FOR_CARD_SUPPRESS_ERRORS);
   if (err)
     return err;
 

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

Summary of changes:
 g10/call-agent.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list