Add patches to fix Gpg(Ex/Ol) UiServer start
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 11 Aug 2016 13:51:45 +0000 (15:51 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 17 Aug 2016 09:40:17 +0000 (11:40 +0200)
* Makefile.am (EXTRA_DIST): Add patches.
* patches/gpgex-1.0.4/
0002-Fix-loop-logic-error-in-new-server-name-detection.patch: New.
* patches/gpgol-1.4.0/
0003-Fix-loop-logic-error-in-new-server-name-detection.patch: New.

(cherry picked from commit 153f313cb7d3c9fd206e0d91b91ed7481794a375)

Conflicts:
Makefile.am

Makefile.am
patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.patch [new file with mode: 0755]
patches/gpgol-1.4.0/0003-Fix-loop-logic-error-in-new-server-name-detection.patch [new file with mode: 0755]

index 6ebb285..266789a 100644 (file)
@@ -50,8 +50,10 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
                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/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch \
+        patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.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 \
+        patches/gpgol-1.4.0/0003-Fix-loop-logic-error-in-new-server-name-detection.patch \
         patches/libgpg-error-1.23/0001-Define-EWOULDBLOCK-in-case-it-is-not-defined.patch
 
 copy-news:
diff --git a/patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.patch b/patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.patch
new file mode 100755 (executable)
index 0000000..66d2484
--- /dev/null
@@ -0,0 +1,50 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 3dddfb2546b839e104286767f504e456ae91df45 Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Thu, 11 Aug 2016 15:45:49 +0200
+Subject: [PATCH] Fix loop logic error in new server name detection
+
+* src/client.cc (default_uiserver_cmdline): Iterate over server_names
+array and not over the first server name itself.
+---
+ src/client.cc | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/client.cc b/src/client.cc
+index 6f27175..ccfa0ac 100644
+--- a/src/client.cc
++++ b/src/client.cc
+@@ -108,7 +108,7 @@ default_uiserver_cmdline (void)
+     }
+ #else /*!ENABLE_GPA_ONLY*/
+     {
+-      const char *dir, *tmp;
++      const char *dir, **tmp;
+       char *uiserver, *p;
+       int extra_arglen = 9;
+       const char * server_names[] = {"kleopatra.exe",
+@@ -163,16 +163,16 @@ default_uiserver_cmdline (void)
+           return name;
+         }
+       /* Fallbacks */
+-      for (tmp = *server_names; *tmp; tmp++)
++      for (tmp = server_names; *tmp; tmp++)
+         {
+           if (name)
+             {
+               free (name);
+             }
+-          name = (char*) malloc (strlen (dir) + strlen (tmp) + extra_arglen + 2);
++          name = (char*) malloc (strlen (dir) + strlen (*tmp) + extra_arglen + 2);
+           if (!name)
+             return NULL;
+-          strcpy (stpcpy (stpcpy (name, dir), "\\"), tmp);
++          strcpy (stpcpy (stpcpy (name, dir), "\\"), *tmp);
+           for (p = name; *p; p++)
+             if (*p == '/')
+               *p = '\\';
+--
+2.1.4
diff --git a/patches/gpgol-1.4.0/0003-Fix-loop-logic-error-in-new-server-name-detection.patch b/patches/gpgol-1.4.0/0003-Fix-loop-logic-error-in-new-server-name-detection.patch
new file mode 100755 (executable)
index 0000000..46cdb8d
--- /dev/null
@@ -0,0 +1,47 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From c8cdb4c9a9bb590b8785b483cf71657e20e0b92d Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Thu, 11 Aug 2016 15:59:57 +0200
+Subject: [PATCH] Fix loop logic error in new server name detection
+
+* src/engine-assuan.c (get_uiserver_name): Fix name loop.
+---
+ src/engine-assuan.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/engine-assuan.c b/src/engine-assuan.c
+index 32dbae8..c60713b 100644
+--- a/src/engine-assuan.c
++++ b/src/engine-assuan.c
+@@ -353,7 +353,7 @@ get_uiserver_name (void)
+                                  "gpa.exe",
+                                  "bin\\gpa.exe",
+                                  NULL};
+-  const char *tmp = NULL;
++  const char **tmp = NULL;
+
+   dir = get_gpg4win_dir ();
+   if (!dir)
+@@ -384,14 +384,14 @@ get_uiserver_name (void)
+       return name;
+     }
+   /* Fallbacks */
+-  for (tmp = *server_names; *tmp; tmp++)
++  for (tmp = server_names; *tmp; tmp++)
+     {
+       if (name)
+         {
+           xfree (name);
+         }
+-      name = xmalloc (strlen (dir) + strlen (tmp) + extra_arglen + 2);
+-      strcpy (stpcpy (stpcpy (name, dir), "\\"), tmp);
++      name = xmalloc (strlen (dir) + strlen (*tmp) + extra_arglen + 2);
++      strcpy (stpcpy (stpcpy (name, dir), "\\"), *tmp);
+       for (p = name; *p; p++)
+         if (*p == '/')
+           *p = '\\';
+--
+2.1.4