[git] GPGME - branch, master, updated. gpgme-1.10.0-9-g7e27a0f

by Andre Heinecke cvs at cvs.gnupg.org
Fri Feb 9 16:11:43 CET 2018


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 "GnuPG Made Easy".

The branch, master has been updated
       via  7e27a0ff64626026521dc5877b278794cea72e61 (commit)
       via  201db83a7f1b7759173b6e9f0a844caef4da6cce (commit)
       via  f10605ffb5cc9d457c3e432918fdfbfaf3d04185 (commit)
       via  5a5b0d4996c17bfbc69b90f89fec23732f92813a (commit)
      from  59fcabbdf537b2745ef0c3cae908b21970a5b39b (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 7e27a0ff64626026521dc5877b278794cea72e61
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Feb 9 16:10:32 2018 +0100

    cpp: Add SpawnShowWindow flag
    
    * lang/cpp/src/context.h (SpawnShowWindow): New.

diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index 4cd5b30..aff8e49 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -408,7 +408,8 @@ public:
     enum SpawnFlags {
         SpawnNone = 0,
         SpawnDetached = 1,
-        SpawnAllowSetFg = 2
+        SpawnAllowSetFg = 2,
+        SpawnShowWindow = 4
     };
     /** Spwan the process \a file with arguments \a argv.
      *

commit 201db83a7f1b7759173b6e9f0a844caef4da6cce
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Feb 9 16:07:58 2018 +0100

    core, w32: Enable spawning GUI applications
    
    * src/engine-spawn.c (engspawn_start): Translate spawn flag
    to IOSPAWN flag.
    * src/gpgme-w32spawn.c (my_spawn): Handle the new flag.
    * src/gpgme.h.in (GPGME_SPAWN_SHOW_WINDOW): New.
    * src/priv-io.h (IOSPAWN_FLAG_SHOW_WINDOW): New.
    
    --
    Used by GpgOL

diff --git a/src/engine-spawn.c b/src/engine-spawn.c
index 7044781..7f78bb5 100644
--- a/src/engine-spawn.c
+++ b/src/engine-spawn.c
@@ -241,7 +241,8 @@ engspawn_start (engine_spawn_t esp, const char *file, const char *argv[],
     spflags |= IOSPAWN_FLAG_DETACHED;
   if ((flags & GPGME_SPAWN_ALLOW_SET_FG))
     spflags |= IOSPAWN_FLAG_ALLOW_SET_FG;
-
+  if ((flags & GPGME_SPAWN_SHOW_WINDOW))
+    spflags |= IOSPAWN_FLAG_SHOW_WINDOW;
 
   err = build_fd_data_map (esp);
   if (err)
diff --git a/src/gpgme-w32spawn.c b/src/gpgme-w32spawn.c
index d86c850..868dbd5 100644
--- a/src/gpgme-w32spawn.c
+++ b/src/gpgme-w32spawn.c
@@ -121,8 +121,6 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
   int duped_stdout = 0;
   int duped_stderr = 0;
   HANDLE hnul = INVALID_HANDLE_VALUE;
-  /* FIXME.  */
-  int debug_me = 0;
 
   i = 0;
   while (argv[i])
@@ -142,7 +140,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags)
   memset (&si, 0, sizeof si);
   si.cb = sizeof (si);
   si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
-  si.wShowWindow = debug_me ? SW_SHOW : SW_HIDE;
+  si.wShowWindow = (flags & IOSPAWN_FLAG_SHOW_WINDOW) ? SW_SHOW : SW_HIDE;
   si.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
   si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
   si.hStdError = GetStdHandle (STD_ERROR_HANDLE);
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 31a9060..ff80023 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -2007,6 +2007,7 @@ gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output,
 /* Flags for the spawn operations.  */
 #define GPGME_SPAWN_DETACHED      1
 #define GPGME_SPAWN_ALLOW_SET_FG  2
+#define GPGME_SPAWN_SHOW_WINDOW   4
 
 
 /* Run the command FILE with the arguments in ARGV.  Connect stdin to
diff --git a/src/priv-io.h b/src/priv-io.h
index 2306175..bc9d3d5 100644
--- a/src/priv-io.h
+++ b/src/priv-io.h
@@ -83,6 +83,8 @@ int _gpgme_io_set_nonblocking (int fd);
 #define IOSPAWN_FLAG_ALLOW_SET_FG 2
 /* Don't close any child FDs.  */
 #define IOSPAWN_FLAG_NOCLOSE 4
+/* Set show window to true for windows */
+#define IOSPAWN_FLAG_SHOW_WINDOW 8
 
 /* Spawn the executable PATH with ARGV as arguments.  After forking
    close all fds except for those in FD_LIST in the child, then

commit f10605ffb5cc9d457c3e432918fdfbfaf3d04185
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Feb 9 16:04:54 2018 +0100

    core, w32: Fix flags passing to gpgme-w32-spawn
    
    * src/w32-io.c (_gpgme_io_spawn): Don't hardcode flags value.
    
    --
    IOSPAWN_FLAG_ALLOW_SET_FG is 2 and was translated to 1.
    
    This might fix the pinentry foreground handling pass through.

diff --git a/src/w32-io.c b/src/w32-io.c
index eed8a00..05e11ee 100644
--- a/src/w32-io.c
+++ b/src/w32-io.c
@@ -1724,8 +1724,8 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
     int written;
     size_t len;
 
-    if ((flags & IOSPAWN_FLAG_ALLOW_SET_FG))
-      strcpy (line, "~1 \n");
+    if (flags)
+      snprintf (line, BUFFER_MAX, "~%i \n", flags);
     else
       strcpy (line, "\n");
     for (i = 0; fd_list[i].fd != -1; i++)

commit 5a5b0d4996c17bfbc69b90f89fec23732f92813a
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Feb 9 16:03:37 2018 +0100

    cpp: Add conveniance Data::toString
    
    * lang/cpp/src/data.h, lang/cpp/src/data.cpp: Add Data::toString.
    
    --
    I'm lazy and like to waste memory.

diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp
index 32ca561..52b8da2 100644
--- a/lang/cpp/src/data.cpp
+++ b/lang/cpp/src/data.cpp
@@ -254,3 +254,17 @@ std::vector<GpgME::Key> GpgME::Data::toKeys(Protocol proto) const
     delete ctx;
     return ret;
 }
+
+std::string GpgME::Data::toString()
+{
+  std::string ret;
+  char buf[4096];
+  size_t nread;
+  seek (0, SEEK_SET);
+  while ((nread = read (buf, 4096)) > 0)
+    {
+      ret += std::string (buf, nread);
+    }
+  seek (0, SEEK_SET);
+  return ret;
+}
diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h
index cc7906f..446f6fa 100644
--- a/lang/cpp/src/data.h
+++ b/lang/cpp/src/data.h
@@ -114,6 +114,9 @@ public:
      * Protocol proto. Returns an empty list on error.*/
     std::vector<Key> toKeys(const Protocol proto = Protocol::OpenPGP) const;
 
+    /** Return a copy of the data as std::string. Sets seek pos to 0 */
+    std::string toString();
+
     class Private;
     Private *impl()
     {

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

Summary of changes:
 lang/cpp/src/context.h |  3 ++-
 lang/cpp/src/data.cpp  | 14 ++++++++++++++
 lang/cpp/src/data.h    |  3 +++
 src/engine-spawn.c     |  3 ++-
 src/gpgme-w32spawn.c   |  4 +---
 src/gpgme.h.in         |  1 +
 src/priv-io.h          |  2 ++
 src/w32-io.c           |  4 ++--
 8 files changed, 27 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list