[git] GnuPG - branch, master, updated. gnupg-2.1.15-201-ge514a5b

by Werner Koch cvs at cvs.gnupg.org
Wed Oct 5 12:00:43 CEST 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 "The GNU Privacy Guard".

The branch, master has been updated
       via  e514a5b725f0c997cef4362808b2778a3faa9cf8 (commit)
       via  1cedc32c95c2e3c3ab98af23ddc2845d51e596c1 (commit)
      from  f57dc2b1e6f28d164f882373535dbcb0d632ca17 (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 e514a5b725f0c997cef4362808b2778a3faa9cf8
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 5 11:51:32 2016 +0200

    wks: Add option --fake-submission-addr to gpg-wks-client.
    
    * tools/gpg-wks-client.c (oFakeSubmissionAddr): New.
    (opts): Add option --fake-submission-addr.
    (fake_submission_addr): New variable.
    (parse_arguments): Set it.
    (command_send): Use --fake-submission-addr.
    --
    
    This option is useful for testing.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c
index f4257ec..4df54cc 100644
--- a/tools/gpg-wks-client.c
+++ b/tools/gpg-wks-client.c
@@ -56,6 +56,7 @@ enum cmd_and_opt_values
 
     oGpgProgram,
     oSend,
+    oFakeSubmissionAddr,
 
     oDummy
   };
@@ -83,6 +84,7 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_s_n (oSend, "send", "send the mail using sendmail"),
   ARGPARSE_s_s (oOutput, "output", "|FILE|write the mail to FILE"),
 
+  ARGPARSE_s_s (oFakeSubmissionAddr, "fake-submission-addr", "@"),
 
   ARGPARSE_end ()
 };
@@ -102,6 +104,11 @@ static struct debug_flags_s debug_flags [] =
   };
 
 
+
+/* Value of the option --fake-submission-addr.  */
+const char *fake_submission_addr;
+
+
 static void wrong_args (const char *text) GPGRT_ATTR_NORETURN;
 static gpg_error_t command_supported (char *userid);
 static gpg_error_t command_send (const char *fingerprint, char *userid);
@@ -180,6 +187,9 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
         case oOutput:
           opt.output = pargs->r.ret_str;
           break;
+        case oFakeSubmissionAddr:
+          fake_submission_addr = pargs->r.ret_str;
+          break;
 
 	case aSupported:
 	case aCreate:
@@ -551,30 +561,37 @@ command_send (const char *fingerprint, char *userid)
     goto leave;
 
   /* Get the submission address.  */
-  err = wkd_get_submission_address (addrspec, &submission_to);
+  if (fake_submission_addr)
+    {
+      submission_to = xstrdup (fake_submission_addr);
+      err = 0;
+    }
+  else
+    err = wkd_get_submission_address (addrspec, &submission_to);
   if (err)
     goto leave;
   log_info ("submitting request to '%s'\n", submission_to);
 
   /* Get the policy flags.  */
-  {
-    estream_t mbuf;
+  if (!fake_submission_addr)
+    {
+      estream_t mbuf;
 
-    err = wkd_get_policy_flags (addrspec, &mbuf);
-    if (err)
-      {
-        log_error ("error reading policy flags for '%s': %s\n",
-                   submission_to, gpg_strerror (err));
-        goto leave;
-      }
-    if (mbuf)
-      {
-        err = wks_parse_policy (&policy, mbuf, 1);
-        es_fclose (mbuf);
-        if (err)
+      err = wkd_get_policy_flags (addrspec, &mbuf);
+      if (err)
+        {
+          log_error ("error reading policy flags for '%s': %s\n",
+                     submission_to, gpg_strerror (err));
           goto leave;
       }
-  }
+      if (mbuf)
+        {
+          err = wks_parse_policy (&policy, mbuf, 1);
+          es_fclose (mbuf);
+          if (err)
+            goto leave;
+        }
+    }
 
   if (policy.auth_submit)
     log_info ("no confirmation required for '%s'\n", addrspec);

commit 1cedc32c95c2e3c3ab98af23ddc2845d51e596c1
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 5 11:48:59 2016 +0200

    agent: Another minor fix to map_supervised_sockets.
    
    * agent/gpg-agent.c (map_supervised_sockets): Remove debug message.
    Provide correct fd in the second error case.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index dcc9bb6..a4025ce 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -739,13 +739,11 @@ map_supervised_sockets (gnupg_fd_t *r_fd,
         {
           for (j = 0; j < DIM (tbl); j++)
             {
-              log_debug ("i=%d j=%d fdname=%s check=%s\n", i, j,
-                         fdnames[i], tbl[j].label);
               if (!strcmp (fdnames[i], tbl[j].label) || j == DIM(tbl)-1)
                 {
+                  fd = 3 + i;
                   if (**tbl[j].fdaddr == -1)
                     {
-                      fd = 3 + i;
                       name = get_socket_name (fd);
                       if (name)
                         {

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

Summary of changes:
 agent/gpg-agent.c      |  4 +---
 tools/gpg-wks-client.c | 49 +++++++++++++++++++++++++++++++++----------------
 2 files changed, 34 insertions(+), 19 deletions(-)


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




More information about the Gnupg-commits mailing list