[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-361-g2223eae

by Werner Koch cvs at cvs.gnupg.org
Fri Mar 14 19:24:56 CET 2014


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  2223eaefaf53aa7217ac593b83e4294148a4db5d (commit)
      from  59b4fb5f4927908af06bb80ecd86adbf6e54ba14 (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 2223eaefaf53aa7217ac593b83e4294148a4db5d
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Mar 14 19:25:58 2014 +0100

    gpg-connect-agent: Make it easier to connect to the dirmngr.
    
    * tools/gpg-connect-agent.c: Add options --dirmngr and
    --dirmngr-program.

diff --git a/doc/tools.texi b/doc/tools.texi
index be1233b..734d619 100644
--- a/doc/tools.texi
+++ b/doc/tools.texi
@@ -1190,6 +1190,18 @@ Try to be as quiet as possible.
 @opindex agent-program
 Specify the agent program to be started if none is running.
 
+ at ifset gpgtwoone
+ at item --dirmngr-program @var{file}
+ at opindex dirmngr-program
+Specify the directory manager (keyserver client) program to be started
+if none is running.  This has only an effect if used together with the
+option @option{--dirmngr}.
+
+ at item --dirmngr
+ at opindex dirmngr
+Connect to a running directory manager (keyserver client) instead of
+to the gpg-agent.  If a dirmngr is not running, start it.
+ at end ifset
 
 @item -S
 @itemx --raw-socket @var{name}
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 6288a97..42e315c 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -1,5 +1,6 @@
 /* gpg-connect-agent.c - Tool to connect to the agent.
  * Copyright (C) 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2014 Werner Koch
  *
  * This file is part of GnuPG.
  *
@@ -58,9 +59,11 @@ enum cmd_and_opt_values
     oNoVerbose	= 500,
     oHomedir,
     oAgentProgram,
+    oDirmngrProgram,
     oHex,
     oDecode,
-    oNoExtConnect
+    oNoExtConnect,
+    oDirmngr
 
   };
 
@@ -73,6 +76,7 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_s_n (oQuiet, "quiet",     N_("quiet")),
   ARGPARSE_s_n (oHex,   "hex",       N_("print data out hex encoded")),
   ARGPARSE_s_n (oDecode,"decode",    N_("decode received data lines")),
+  ARGPARSE_s_n (oDirmngr,"dirmngr",  N_("connect to the dirmngr")),
   ARGPARSE_s_s (oRawSocket, "raw-socket",
                 N_("|NAME|connect to Assuan socket NAME")),
   ARGPARSE_s_s (oTcpSocket, "tcp-socket",
@@ -88,6 +92,7 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_s_n (oNoVerbose, "no-verbose", "@"),
   ARGPARSE_s_s (oHomedir, "homedir", "@" ),
   ARGPARSE_s_s (oAgentProgram, "agent-program", "@"),
+  ARGPARSE_s_s (oDirmngrProgram, "dirmngr-program", "@"),
 
   ARGPARSE_end ()
 };
@@ -100,8 +105,10 @@ struct
   int quiet;		/* Be extra quiet.  */
   const char *homedir;  /* Configuration directory name */
   const char *agent_program;  /* Value of --agent-program.  */
+  const char *dirmngr_program;  /* Value of --dirmngr-program.  */
   int hex;              /* Print data lines in hex format. */
   int decode;           /* Decode received data lines.  */
+  int use_dirmngr;      /* Use the dirmngr and not gpg-agent.  */
   const char *raw_socket; /* Name of socket to connect in raw mode. */
   const char *tcp_socket; /* Name of server to connect in tcp mode. */
   int exec;             /* Run the pgm given on the command line. */
@@ -1207,8 +1214,10 @@ main (int argc, char **argv)
         case oNoVerbose: opt.verbose = 0; break;
         case oHomedir:   opt.homedir = pargs.r.ret_str; break;
         case oAgentProgram: opt.agent_program = pargs.r.ret_str;  break;
+        case oDirmngrProgram: opt.dirmngr_program = pargs.r.ret_str;  break;
         case oHex:       opt.hex = 1; break;
         case oDecode:    opt.decode = 1; break;
+        case oDirmngr:   opt.use_dirmngr = 1; break;
         case oRawSocket: opt.raw_socket = pargs.r.ret_str; break;
         case oTcpSocket: opt.tcp_socket = pargs.r.ret_str; break;
         case oExec:      opt.exec = 1; break;
@@ -2202,15 +2211,22 @@ start_agent (void)
   if (!session_env)
     log_fatal ("error allocating session environment block: %s\n",
                strerror (errno));
-
-  err = start_new_gpg_agent (&ctx,
+  if (opt.use_dirmngr)
+    err = start_new_dirmngr (&ctx,
                              GPG_ERR_SOURCE_DEFAULT,
                              opt.homedir,
-                             opt.agent_program,
-                             NULL, NULL,
-                             session_env,
+                             opt.dirmngr_program,
                              !opt.quiet, 0,
                              NULL, NULL);
+  else
+    err = start_new_gpg_agent (&ctx,
+                               GPG_ERR_SOURCE_DEFAULT,
+                               opt.homedir,
+                               opt.agent_program,
+                               NULL, NULL,
+                               session_env,
+                               !opt.quiet, 0,
+                               NULL, NULL);
 
   session_env_release (session_env);
   if (err)

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

Summary of changes:
 doc/tools.texi            |   12 ++++++++++++
 tools/gpg-connect-agent.c |   28 ++++++++++++++++++++++------
 2 files changed, 34 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list