[git] GnuPG - branch, master, updated. gnupg-2.1.0-49-g7aee357

by Werner Koch cvs at cvs.gnupg.org
Fri Nov 28 09:44:07 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  7aee3579be6e24a1aa280e75615fc3a11ceef960 (commit)
      from  f173cdcdfbfd083b035516a406c2c754f38a0ace (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 7aee3579be6e24a1aa280e75615fc3a11ceef960
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 28 09:44:19 2014 +0100

    Add option --no-autostart.
    
    * g10/gpg.c: Add option --no-autostart.
    * sm/gpgsm.c: Ditto.
    * g10/options.h (opt): Add field autostart.
    * sm/gpgsm.h (opt): Ditto.
    * g10/call-agent.c (start_agent): Print note if agent was not
    autostarted.
    * sm/call-agent.c (start_agent): Ditto.
    * g10/call-dirmngr.c (create_context): Likewise.
    * sm/call-dirmngr.c (start_dirmngr_ext): Ditto.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gpg.texi b/doc/gpg.texi
index 634b4e2..71ffaf8 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -1735,6 +1735,14 @@ fallback when the environment variable @code{DIRMNGR_INFO} is not set or
 a running dirmngr cannot be connected.
 @end ifset
 
+ at item --no-autostart
+ at opindex no-autostart
+Do not start the gpg-agent or the dirmngr if it has not yet been
+started and its service is required.  This option is mostly useful on
+machines where the connection to gpg-agent has been redirected to
+another machines.  If dirmngr is required on the remote machine, it
+may be started manually using @command{gpgconf --launch dirmngr}.
+
 @item --lock-once
 @opindex lock-once
 Lock the databases the first time a lock is requested
diff --git a/doc/gpgsm.texi b/doc/gpgsm.texi
index 2ddedcd..dcfe292 100644
--- a/doc/gpgsm.texi
+++ b/doc/gpgsm.texi
@@ -384,6 +384,14 @@ always used.
 @item --disable-dirmngr
 Entirely disable the use of the Dirmngr.
 
+ at item --no-autostart
+ at opindex no-autostart
+Do not start the gpg-agent or the dirmngr if it has not yet been
+started and its service is required.  This option is mostly useful on
+machines where the connection to gpg-agent has been redirected to
+another machines.  If dirmngr is required on the remote machine, it
+may be started manually using @command{gpgconf --launch dirmngr}.
+
 @item --no-secmem-warning
 @opindex no-secmem-warning
 Do not print a warning when the so called "secure memory" cannot be used.
diff --git a/doc/tools.texi b/doc/tools.texi
index d556b6d..0de214b 100644
--- a/doc/tools.texi
+++ b/doc/tools.texi
@@ -1241,6 +1241,11 @@ When using @option{-S} or @option{--exec}, @command{gpg-connect-agent}
 connects to the assuan server in extended mode to allow descriptor
 passing.  This option makes it use the old mode.
 
+ at item --no-autostart
+ at opindex no-autostart
+Do not start the gpg-agent or the dirmngr if it has not yet been
+started.
+
 @item --run @var{file}
 @opindex run
 Run the commands from @var{file} at startup and then continue with the
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 74d8cec..f5c943d 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -285,9 +285,19 @@ start_agent (ctrl_t ctrl, int for_card)
                                 opt.agent_program,
                                 opt.lc_ctype, opt.lc_messages,
                                 opt.session_env,
-                                1, opt.verbose, DBG_ASSUAN,
+                                opt.autostart, opt.verbose, DBG_ASSUAN,
                                 NULL, NULL);
-      if (!rc)
+      if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT)
+        {
+          static int shown;
+
+          if (!shown)
+            {
+              shown = 1;
+              log_info (_("no gpg-agent running in this session\n"));
+            }
+        }
+      else if (!rc)
         {
           /* Tell the agent that we support Pinentry notifications.
              No error checking so that it will work also with older
diff --git a/g10/call-dirmngr.c b/g10/call-dirmngr.c
index 7150853..b802f81 100644
--- a/g10/call-dirmngr.c
+++ b/g10/call-dirmngr.c
@@ -130,9 +130,19 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx)
                            GPG_ERR_SOURCE_DEFAULT,
                            opt.homedir,
                            opt.dirmngr_program,
-                           1, opt.verbose, DBG_ASSUAN,
+                           opt.autostart, opt.verbose, DBG_ASSUAN,
                            NULL /*gpg_status2*/, ctrl);
-  if (!err)
+  if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR)
+    {
+      static int shown;
+
+      if (!shown)
+        {
+          shown = 1;
+          log_info (_("no dirmngr running in this session\n"));
+        }
+    }
+  else if (!err)
     {
       keyserver_spec_t ksi;
 
diff --git a/g10/gpg.c b/g10/gpg.c
index a2225a0..6e6407a 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -379,6 +379,7 @@ enum cmd_and_opt_values
     oNoAllowMultipleMessages,
     oAllowWeakDigestAlgos,
     oFakedSystemTime,
+    oNoAutostart,
 
     oNoop
   };
@@ -786,6 +787,7 @@ static ARGPARSE_OPTS opts[] = {
   /* New options.  Fixme: Should go more to the top.  */
   ARGPARSE_s_s (oAutoKeyLocate, "auto-key-locate", "@"),
   ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"),
+  ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"),
 
   /* Dummy options with warnings.  */
   ARGPARSE_s_n (oUseAgent,      "use-agent", "@"),
@@ -2080,6 +2082,7 @@ main (int argc, char **argv)
 
     dotlock_create (NULL, 0); /* Register lock file cleanup. */
 
+    opt.autostart = 1;
     opt.session_env = session_env_new ();
     if (!opt.session_env)
       log_fatal ("error allocating session environment block: %s\n",
@@ -3131,6 +3134,8 @@ main (int argc, char **argv)
             }
             break;
 
+          case oNoAutostart: opt.autostart = 0; break;
+
 	  case oNoop: break;
 
 	  default:
diff --git a/g10/options.h b/g10/options.h
index 6a94ff4..7ec81af 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -53,6 +53,7 @@ struct
   estream_t outfp;  /* Hack, sometimes used in place of outfile.  */
   off_t max_output;
   int dry_run;
+  int autostart;
   int list_only;
   int textmode;
   int expert;
diff --git a/sm/call-agent.c b/sm/call-agent.c
index 59b1509..f579200 100644
--- a/sm/call-agent.c
+++ b/sm/call-agent.c
@@ -95,10 +95,20 @@ start_agent (ctrl_t ctrl)
                                 opt.agent_program,
                                 opt.lc_ctype, opt.lc_messages,
                                 opt.session_env,
-                                1, opt.verbose, DBG_ASSUAN,
+                                opt.autostart, opt.verbose, DBG_ASSUAN,
                                 gpgsm_status2, ctrl);
 
-      if (!rc)
+      if (!opt.autostart && gpg_err_code (rc) == GPG_ERR_NO_AGENT)
+        {
+          static int shown;
+
+          if (!shown)
+            {
+              shown = 1;
+              log_info (_("no gpg-agent running in this session\n"));
+            }
+        }
+      else if (!rc)
         {
           /* Tell the agent that we support Pinentry notifications.  No
              error checking so that it will work also with older
diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c
index 4dc8425..f8cfdf8 100644
--- a/sm/call-dirmngr.c
+++ b/sm/call-dirmngr.c
@@ -209,8 +209,18 @@ start_dirmngr_ext (ctrl_t ctrl, assuan_context_t *ctx_r)
 
   err = start_new_dirmngr (&ctx, GPG_ERR_SOURCE_DEFAULT,
                            opt.homedir, opt.dirmngr_program,
-                           1, opt.verbose, DBG_ASSUAN,
+                           opt.autostart, opt.verbose, DBG_ASSUAN,
                            gpgsm_status2, ctrl);
+  if (!opt.autostart && gpg_err_code (err) == GPG_ERR_NO_DIRMNGR)
+    {
+      static int shown;
+
+      if (!shown)
+        {
+          shown = 1;
+          log_info (_("no dirmngr running in this session\n"));
+        }
+    }
   prepare_dirmngr (ctrl, ctx, err);
   if (err)
     return err;
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 03b9bb9..3398d17 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -183,7 +183,8 @@ enum cmd_and_opt_values {
   oIgnoreTimeConflict,
   oNoRandomSeedFile,
   oNoCommonCertsImport,
-  oIgnoreCertExtension
+  oIgnoreCertExtension,
+  oNoAutostart
  };
 
 
@@ -391,6 +392,7 @@ static ARGPARSE_OPTS opts[] = {
   ARGPARSE_s_n (oNoRandomSeedFile,  "no-random-seed-file", "@"),
   ARGPARSE_s_n (oNoCommonCertsImport, "no-common-certs-import", "@"),
   ARGPARSE_s_s (oIgnoreCertExtension, "ignore-cert-extension", "@"),
+  ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"),
 
   /* Command aliases.  */
   ARGPARSE_c (aListKeys, "list-key", "@"),
@@ -940,6 +942,7 @@ main ( int argc, char **argv)
 
   dotlock_create (NULL, 0); /* Register lockfile cleanup.  */
 
+  opt.autostart = 1;
   opt.session_env = session_env_new ();
   if (!opt.session_env)
     log_fatal ("error allocating session environment block: %s\n",
@@ -1417,6 +1420,8 @@ main ( int argc, char **argv)
           add_to_strlist (&opt.ignored_cert_extensions, pargs.r.ret_str);
           break;
 
+        case oNoAutostart: opt.autostart = 0; break;
+
         default:
           pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
           break;
diff --git a/sm/gpgsm.h b/sm/gpgsm.h
index e8322b7..63c9d0b 100644
--- a/sm/gpgsm.h
+++ b/sm/gpgsm.h
@@ -69,6 +69,7 @@ struct
   char *lc_ctype;
   char *lc_messages;
 
+  int autostart;
   const char *dirmngr_program;
   int disable_dirmngr;        /* Do not do any dirmngr calls.  */
   const char *protect_tool_program;

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

Summary of changes:
 doc/gpg.texi       |    8 ++++++++
 doc/gpgsm.texi     |    8 ++++++++
 doc/tools.texi     |    5 +++++
 g10/call-agent.c   |   14 ++++++++++++--
 g10/call-dirmngr.c |   14 ++++++++++++--
 g10/gpg.c          |    5 +++++
 g10/options.h      |    1 +
 sm/call-agent.c    |   14 ++++++++++++--
 sm/call-dirmngr.c  |   12 +++++++++++-
 sm/gpgsm.c         |    7 ++++++-
 sm/gpgsm.h         |    1 +
 11 files changed, 81 insertions(+), 8 deletions(-)


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




More information about the Gnupg-commits mailing list