[git] GnuPG - branch, master, updated. gnupg-2.2.7-346-g140fda8

by Werner Koch cvs at cvs.gnupg.org
Wed Jan 30 14:40:44 CET 2019


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  140fda8c61422ec055c3f7e214cc35706c4320dd (commit)
       via  1fd3d864b4eceaf45b33e754e5d832b7ccc0d17f (commit)
      from  346a98fabe03adf2e202e36fc2aa24b1c2571154 (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 140fda8c61422ec055c3f7e214cc35706c4320dd
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 30 14:40:26 2019 +0100

    gpg: Emit an ERROR status if no key was found with --list-keys.
    
    * g10/keylist.c (list_one): Emit status line.
    --
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/keylist.c b/g10/keylist.c
index 0b8aa88..fffd95c 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -611,6 +611,7 @@ list_one (ctrl_t ctrl, strlist_t names, int secret, int mark_secret)
     {
       log_error ("error reading key: %s\n", gpg_strerror (rc));
       getkey_end (ctrl, ctx);
+      write_status_error ("keylist.getkey", rc);
       return;
     }
 

commit 1fd3d864b4eceaf45b33e754e5d832b7ccc0d17f
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 30 14:38:37 2019 +0100

    common: Add kludge to allow silencing gnupg_exec_tool_stream.
    
    * common/exectool.c (read_and_log_buffer_t): Take care of a --quiet
    argument.
    (gnupg_exec_tool_stream): Ditto.
    --
    
    If we pass --quiet to a program it should really shutup and the parent
    should be quite as well.

diff --git a/common/exectool.c b/common/exectool.c
index 3458de4..82b3985 100644
--- a/common/exectool.c
+++ b/common/exectool.c
@@ -53,6 +53,7 @@ typedef struct
   exec_tool_status_cb_t status_cb;
   void *status_cb_value;
   int cont;
+  int quiet;
   size_t used;
   size_t buffer_size;
   char *buffer;
@@ -110,6 +111,8 @@ read_and_log_stderr (read_and_log_buffer_t *state, es_poll_t *fderr)
               state->status_cb (state->status_cb_value,
                                 state->buffer + 9, rest);
             }
+          else if (state->quiet)
+            ;
           else if (!state->cont
               && !strncmp (state->buffer, pname, len)
               && strlen (state->buffer) > strlen (pname)
@@ -331,10 +334,16 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
   int count;
   read_and_log_buffer_t fderrstate;
   struct copy_buffer *cpbuf_in = NULL, *cpbuf_out = NULL, *cpbuf_extra = NULL;
+  int quiet = 0;
+  int dummy_exitcode;
 
   memset (fds, 0, sizeof fds);
   memset (&fderrstate, 0, sizeof fderrstate);
 
+  /* If the first argument to the program is "--quiet" avoid all extra
+   * diagnostics.  */
+  quiet = (argv && argv[0] && !strcmp (argv[0], "--quiet"));
+
   cpbuf_in = xtrymalloc (sizeof *cpbuf_in);
   if (cpbuf_in == NULL)
     {
@@ -360,6 +369,7 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
   copy_buffer_init (cpbuf_extra);
 
   fderrstate.pgmname = pgmname;
+  fderrstate.quiet = quiet;
   fderrstate.status_cb = status_cb;
   fderrstate.status_cb_value = status_cb_value;
   fderrstate.buffer_size = 256;
@@ -375,7 +385,7 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
       err = gnupg_create_outbound_pipe (extrapipe, &extrafp, 1);
       if (err)
         {
-          log_error ("error running outbound pipe for extra fp: %s\n",
+          log_error ("error creating outbound pipe for extra fp: %s\n",
                      gpg_strerror (err));
           goto leave;
         }
@@ -411,7 +421,8 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
     argv[argsaveidx] = argsave;
   if (err)
     {
-      log_error ("error running '%s': %s\n", pgmname, gpg_strerror (err));
+      if (!quiet)
+        log_error ("error running '%s': %s\n", pgmname, gpg_strerror (err));
       goto leave;
     }
 
@@ -535,7 +546,7 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
   es_fclose (outfp); outfp = NULL;
   es_fclose (errfp); errfp = NULL;
 
-  err = gnupg_wait_process (pgmname, pid, 1, NULL);
+  err = gnupg_wait_process (pgmname, pid, 1, quiet? &dummy_exitcode : NULL);
   pid = (pid_t)(-1);
 
  leave:
@@ -547,7 +558,7 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[],
   es_fclose (outfp);
   es_fclose (errfp);
   if (pid != (pid_t)(-1))
-    gnupg_wait_process (pgmname, pid, 1, NULL);
+    gnupg_wait_process (pgmname, pid, 1,  quiet? &dummy_exitcode : NULL);
   gnupg_release_process (pid);
 
   copy_buffer_shred (cpbuf_in);

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

Summary of changes:
 common/exectool.c | 19 +++++++++++++++----
 g10/keylist.c     |  1 +
 2 files changed, 16 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list