[git] GPGME - branch, master, updated. gpgme-1.6.0-290-g9cf983b

by Andre Heinecke cvs at cvs.gnupg.org
Thu Aug 18 17:10:09 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 "GnuPG Made Easy".

The branch, master has been updated
       via  9cf983b0199950c8f8cccee2cb8e45aafcba9fd1 (commit)
      from  64194b0f8df1afe6135cd119fd3216fc8db68033 (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 9cf983b0199950c8f8cccee2cb8e45aafcba9fd1
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Aug 18 16:56:58 2016 +0200

    core: Fail loudly in case w32 spawner not found
    
    * src/w32-io.c (_gpgme_io_spawn): Show a message box in
    case gpgme-w32spawn.exe not found.
    
    --
    Otherwise every engine call will just fail with unsupported
    protocol. Even in the debug output the problem was not made
    clear because CreateProcess will fail with error code 87
    (Invalid Parameter) because spawnhelper is NULL. The helpful
    error message for ERROR_INVALID_PARAMETER would have been:
    "is 'NULL' correctly installed"
    
    As GpgME basically becomes useless on Windows without the
    spawnhelper we want to fail very loud in that case.

diff --git a/src/w32-io.c b/src/w32-io.c
index 8e7abd3..9aaaeeb 100644
--- a/src/w32-io.c
+++ b/src/w32-io.c
@@ -50,6 +50,7 @@
 #include "sema.h"
 #include "priv-io.h"
 #include "debug.h"
+#include "sys-util.h"
 
 
 /* FIXME: Optimize.  */
@@ -1605,6 +1606,31 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
     cr_flags |= DETACHED_PROCESS;
   cr_flags |= GetPriorityClass (GetCurrentProcess ());
   spawnhelper = _gpgme_get_w32spawn_path ();
+  if (!spawnhelper)
+    {
+      /* This is a common mistake for new users of gpgme not to include
+         gpgme-w32spawn.exe with their binary. So we want to make
+         this transparent to developers. If users have somehow messed
+         up their installation this should also be properly communicated
+         as otherwise calls to gnupg will result in unsupported protocol
+         errors that do not explain a lot. */
+      char *msg;
+      gpgrt_asprintf (&msg, "gpgme-w32spawn.exe was not found in the "
+                            "detected installation directory of GpgME"
+                            "\n\t\"%s\"\n\n"
+                            "Crypto operations will not work.\n\n"
+                            "If you see this it indicates a problem "
+                            "with your installation.\n"
+                            "Please report the problem to your "
+                            "distributor of GpgME.\n\n"
+                            "Developers Note: The install dir can be "
+                            "manually set with: gpgme_set_global_flag",
+                            _gpgme_get_inst_dir ());
+      MessageBoxA (NULL, msg, "GpgME not installed correctly", MB_OK);
+      free (msg);
+      gpg_err_set_errno (EIO);
+      return TRACE_SYSRES (-1);
+    }
   if (!CreateProcessA (spawnhelper,
 		       arg_string,
 		       &sec_attr,     /* process security attributes */

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

Summary of changes:
 src/w32-io.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)


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




More information about the Gnupg-commits mailing list