Add patches for gpgol and gpgex
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 4 Jul 2016 13:07:31 +0000 (15:07 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 4 Jul 2016 13:07:31 +0000 (15:07 +0200)
* patches/gpgex-1.0.4/
0001-Prefer-kleowrapped-gpgwrapped-binaries.patch,
patches/gpgol-1.4.0/0001-Fix-UI-Server-startup.patch,
patches/gpgol-1.4.0/
0002-Ignore-sent-S-MIME-Mails-if-S-MIME-is-disabled.patch: New.
* Makefile.am (EXTRA_DIST): Update accordingly.

--
Patches are already applied in master of gpgol and gpgex
and fix regressions in the UI-Server startup and one small
S/MIME related bug in GpgOL.

Makefile.am
patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch [new file with mode: 0755]
patches/gpgol-1.4.0/0001-Fix-UI-Server-startup.patch [new file with mode: 0755]
patches/gpgol-1.4.0/0002-Ignore-sent-S-MIME-Mails-if-S-MIME-is-disabled.patch [new file with mode: 0755]

index 85a75c5..c23de0e 100644 (file)
@@ -48,7 +48,10 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/libtasn1-2.14/gnulib-mingw-w64-fix.patch \
                patches/w32pth-2.0.5/workaround-broken-libtool.patch \
                patches/scute-1.4.0/workaround-broken-libtool.patch \
-               patches/libassuan-2.4.0/0001-Fix-windows-build-with-mingw-w64-2.0.x.patch
+               patches/libassuan-2.4.0/0001-Fix-windows-build-with-mingw-w64-2.0.x.patch \
+        patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch \
+        patches/gpgol-1.4.0/0001-Fix-UI-Server-startup.patch \
+        patches/gpgol-1.4.0/0002-Ignore-sent-S-MIME-Mails-if-S-MIME-is-disabled.patch
 
 copy-news:
        cp NEWS doc/website/NEWS.last
diff --git a/patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch b/patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch
new file mode 100755 (executable)
index 0000000..9052ed3
--- /dev/null
@@ -0,0 +1,43 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 5c19ffe9d71d6e6763d6e47a67f1ca0a1651e39f Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Tue, 28 Jun 2016 11:00:53 +0200
+Subject: [PATCH] Prefer kleowrapped / gpgwrapped binaries
+
+* src/client.cc (default_uiserver_cmdline): Prefer non "bin" prefixed
+paths.
+
+--
+With Gpg4win-2.x we need to start the "wrapped" binaries if they
+don't exist we are probably in gpg4win-3.x and can fall back to
+the binaries in the bin subdirectory.
+---
+ src/client.cc | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/client.cc b/src/client.cc
+index ebf82a8..6f27175 100644
+--- a/src/client.cc
++++ b/src/client.cc
+@@ -111,12 +111,12 @@ default_uiserver_cmdline (void)
+       const char *dir, *tmp;
+       char *uiserver, *p;
+       int extra_arglen = 9;
+-      const char * server_names[] = {"bin\\kleopatra.exe",
+-                                     "kleopatra.exe",
+-                                     "bin\\launch-gpa.exe",
++      const char * server_names[] = {"kleopatra.exe",
++                                     "bin\\kleopatra.exe",
+                                      "launch-gpa.exe",
+-                                     "bin\\gpa.exe",
++                                     "bin\\launch-gpa.exe",
+                                      "gpa.exe",
++                                     "bin\\gpa.exe",
+                                      NULL};
+
+       dir = gpgex_server::root_dir;
+--
+2.1.4
diff --git a/patches/gpgol-1.4.0/0001-Fix-UI-Server-startup.patch b/patches/gpgol-1.4.0/0001-Fix-UI-Server-startup.patch
new file mode 100755 (executable)
index 0000000..20f91d8
--- /dev/null
@@ -0,0 +1,71 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From a10532b6cf3527391bdb14470fbebf0205b9253a Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Tue, 28 Jun 2016 10:47:38 +0200
+Subject: [PATCH 1/2] Fix UI Server startup
+
+* src/common.c (get_gpg4win_dir): Fix stupid logic error in loop.
+Fix mem leak on error.
+* src/engine-assuan.c (get_uiserver_name): Prefer 2.3.x names to
+prefer the kleowrapped / gpgwrapped exectuables.
+
+--
+Thanks to rpr who reported this on the gpg4win message board.
+---
+ src/common.c        | 11 ++++++++---
+ src/engine-assuan.c |  6 +++---
+ 2 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/src/common.c b/src/common.c
+index b7b48b0..9b554b2 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -1245,10 +1245,10 @@ get_gpg4win_dir()
+   const char *g4win_keys[] = {GPG4WIN_REGKEY_3,
+                               GPG4WIN_REGKEY_2,
+                               NULL};
+-  const char *key;
+-  for (key = *g4win_keys; *key; key++)
++  const char **key;
++  for (key = g4win_keys; *key; key++)
+     {
+-      char *tmp = read_w32_registry_string (NULL, key, "Install Directory");
++      char *tmp = read_w32_registry_string (NULL, *key, "Install Directory");
+       if (!tmp)
+         {
+           continue;
+@@ -1257,6 +1257,11 @@ get_gpg4win_dir()
+         {
+           return tmp;
+         }
++      else
++        {
++          log_debug ("Failed to access: %s\n", tmp);
++          xfree (tmp);
++        }
+     }
+   return NULL;
+ }
+diff --git a/src/engine-assuan.c b/src/engine-assuan.c
+index f2e0b09..32dbae8 100644
+--- a/src/engine-assuan.c
++++ b/src/engine-assuan.c
+@@ -348,10 +348,10 @@ get_uiserver_name (void)
+   char *dir, *uiserver, *p;
+   int extra_arglen = 9;
+
+-  const char * server_names[] = {"bin\\kleopatra.exe",
+-                                 "kleopatra.exe",
+-                                 "bin\\gpa.exe",
++  const char * server_names[] = {"kleopatra.exe",
++                                 "bin\\kleopatra.exe",
+                                  "gpa.exe",
++                                 "bin\\gpa.exe",
+                                  NULL};
+   const char *tmp = NULL;
+
+--
+2.1.4
diff --git a/patches/gpgol-1.4.0/0002-Ignore-sent-S-MIME-Mails-if-S-MIME-is-disabled.patch b/patches/gpgol-1.4.0/0002-Ignore-sent-S-MIME-Mails-if-S-MIME-is-disabled.patch
new file mode 100755 (executable)
index 0000000..5b65c40
--- /dev/null
@@ -0,0 +1,39 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 643575f38f545456afc456e1045b914d3d06bbb8 Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Wed, 29 Jun 2016 17:17:48 +0200
+Subject: [PATCH 2/2] Ignore sent S/MIME Mails if S/MIME is disabled
+
+* src/mapihelp.cpp (mapi_change_message_class): Add check for
+S/MIME disabled.
+
+--
+Outlook sets sent Mails to IPM.Note.SMIME (without suffix). When
+S/MIME is disabled we need to ignore these messages. Our own
+messages that are marked as S/MIME messages on send even if they
+are PGP Messages have the override message class set so they are not
+affected by this.
+
+GnuPG-Bug-Id: 2319
+---
+ src/mapihelp.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mapihelp.cpp b/src/mapihelp.cpp
+index 7d11364..e916209 100644
+--- a/src/mapihelp.cpp
++++ b/src/mapihelp.cpp
+@@ -1226,7 +1226,7 @@ mapi_change_message_class (LPMESSAGE message, int sync_override)
+         {
+           newvalue = change_message_class_ipm_note (message);
+         }
+-      else if (!strcmp (s, "IPM.Note.SMIME"))
++      else if (opt.enable_smime && !strcmp (s, "IPM.Note.SMIME"))
+         {
+           newvalue = change_message_class_ipm_note_smime (message);
+         }
+--
+2.1.4