Update glib patches and remove rand_s usage.
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 17 Nov 2014 11:58:15 +0000 (12:58 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 17 Nov 2014 11:58:15 +0000 (12:58 +0100)
    * NEWS: Mention rand_s removal (fixes xp compatibility).
    * patches/glib-2.34.3/02-no-kill.patch: Removed. Problem
    addressed upstream.
    * patches/glib-2.34.3/01-socket.patch: Moved to 2.41.0.
    * patches/glib-2.41.0/03-remove-rand_s.patch: New. Reverts
    upstream commit 0e1924a.

--
    The remove-rand_s patch can be removed when we use mingw
    libraries > 3.1 as they no longer import rand_s directly
    but load it at runtime / use a fallback which also works
    on Windows XP.

Makefile.am
NEWS
patches/glib-2.34.3/02-no-kill.patch [deleted file]
patches/glib-2.41.0/01-socket.patch [moved from patches/glib-2.34.3/01-socket.patch with 100% similarity]
patches/glib-2.41.0/03-remove-rand_s.patch [new file with mode: 0755]

index 73c7b0f..abd62e2 100644 (file)
@@ -36,8 +36,9 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/claws-mail-3.9.1/51-version-file.patch \
         patches/claws-mail-3.9.1/80-src-makefile.postcfg-build \
         patches/dirmngr-1.1.1/dirmngr-pth.patch \
-        patches/glib-2.34.3/01-socket.patch \
-        patches/glib-2.34.3/02-no-kill.patch \
+        patches/glib-2.41.0/01-socket.patch \
+        patches/glib-2.41.0/02-no-kill.patch \
+        patches/glib-2.41.0/03-remove-rand_s.patch \
         patches/gnupg2-2.0.26/0001-Enable-wildcard-expansion-with-mingw-w64.patch \
         patches/gnupg2/01-version.patch \
         patches/gnupg2/01-version.patch.in \
diff --git a/NEWS b/NEWS
index c0fcc3b..5f520fb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,7 @@
 
 Noteworthy changes in version 2.2.3 (unreleased)
 ------------------------------------------------
-(en) The vanilla installer has been fixed and now also includes GnuTLS
+(en) The vanilla installer has been fixed and now also includes GnuTLS.
 
 (de) Das Vanilla Installationspaket enthält nun GnuTLS und kann somit
      wieder verwendet werden.
@@ -15,6 +15,10 @@ Noteworthy changes in version 2.2.3 (unreleased)
 (de) Die Erstellung einer portablen Version mit mkportable funktioniert
      nun wieder.
 
+(en) GPA now works again under Windows XP.
+
+(de) GPA funktioniert nun auch wieder unter Windows XP.
+
 ~~~~~~~~~~~~~~~
 GnuPG:          2.0.26
 Kleopatra:      2.2.0-gitac229d2
diff --git a/patches/glib-2.34.3/02-no-kill.patch b/patches/glib-2.34.3/02-no-kill.patch
deleted file mode 100755 (executable)
index 029f42a..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-patch -p0 -f $* < $0
-exit $?
-
-Replace kill() by TerminateProcess.  "interface" is a macro in Windows
-and thus we need to rename it too.
-
-
---- gio/tests/gdbus-proxy.c~   2012-11-26 17:52:48.000000000 +0100
-+++ gio/tests/gdbus-proxy.c    2013-04-30 09:56:34.301673374 +0200
-@@ -23,6 +23,9 @@
- #include <gio/gio.h>
- #include <unistd.h>
- #include <string.h>
-+#ifdef G_OS_WIN32
-+# include <windows.h>
-+#endif
-
- #include "gdbus-tests.h"
-
-@@ -693,7 +696,7 @@ test_basic (GDBusProxy *proxy)
-   GDBusInterfaceInfo *info;
-   gchar *name;
-   gchar *path;
--  gchar *interface;
-+  gchar *iface;
-   gint timeout;
-
-   connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
-@@ -712,7 +715,7 @@ test_basic (GDBusProxy *proxy)
-                 "g-flags", &flags,
-                 "g-name", &name,
-                 "g-object-path", &path,
--                "g-interface-name", &interface,
-+                "g-interface-name", &iface,
-                 "g-default-timeout", &timeout,
-                 NULL);
-
-@@ -721,13 +724,13 @@ test_basic (GDBusProxy *proxy)
-   g_assert_cmpint (flags, ==, G_DBUS_PROXY_FLAGS_NONE);
-   g_assert_cmpstr (name, ==, "com.example.TestService");
-   g_assert_cmpstr (path, ==, "/com/example/TestObject");
--  g_assert_cmpstr (interface, ==, "com.example.Frob");
-+  g_assert_cmpstr (iface, ==, "com.example.Frob");
-   g_assert_cmpint (timeout, ==, -1);
-
-   g_object_unref (conn);
-   g_free (name);
-   g_free (path);
--  g_free (interface);
-+  g_free (iface);
-
-   g_object_unref (connection);
- }
-@@ -753,7 +756,14 @@ kill_test_service (GDBusConnection *conn
-                                      &error);
-   g_variant_get (ret, "(u)", &pid);
-   g_variant_unref (ret);
-+#ifdef G_OS_WIN32
-+  {
-+    HANDLE process = (HANDLE) pid;
-+    TerminateProcess (process, 1);
-+  }
-+#else
-   kill (pid, SIGTERM);
-+#endif
- }
-
- static void
diff --git a/patches/glib-2.41.0/03-remove-rand_s.patch b/patches/glib-2.41.0/03-remove-rand_s.patch
new file mode 100755 (executable)
index 0000000..2ee3cdb
--- /dev/null
@@ -0,0 +1,76 @@
+#! /bin/sh
+patch -p1 -R -f $* < $0
+exit $?
+
+From 0e1924a66c642d4aa4a30b97cff509903f972435 Mon Sep 17 00:00:00 2001
+From: Ryan Lortie <desrt@desrt.ca>
+Date: Fri, 25 Oct 2013 12:22:42 -0400
+Subject: win32: use real random data for seed on win32
+
+We can get cryptographically secure data from rand_s().
+
+https://bugzilla.gnome.org/show_bug.cgi?id=710738
+
+diff --git a/glib/grand.c b/glib/grand.c
+index 9b2c0f8..56e443d 100644
+--- a/glib/grand.c
++++ b/glib/grand.c
+@@ -37,6 +37,7 @@
+  */
+
+ #include "config.h"
++#define _CRT_RAND_S
+
+ #include <math.h>
+ #include <errno.h>
+@@ -56,7 +57,7 @@
+ #include "gthread.h"
+
+ #ifdef G_OS_WIN32
+-#include <process.h>          /* For getpid() */
++#include <stdlib.h>
+ #endif
+
+ /**
+@@ -219,9 +221,9 @@ GRand*
+ g_rand_new (void)
+ {
+   guint32 seed[4];
+-  GTimeVal now;
+ #ifdef G_OS_UNIX
+   static gboolean dev_urandom_exists = TRUE;
++  GTimeVal now;
+
+   if (dev_urandom_exists)
+     {
+@@ -253,9 +255,6 @@ g_rand_new (void)
+       else
+       dev_urandom_exists = FALSE;
+     }
+-#else
+-  static gboolean dev_urandom_exists = FALSE;
+-#endif
+
+   if (!dev_urandom_exists)
+     {
+@@ -263,12 +262,14 @@ g_rand_new (void)
+       seed[0] = now.tv_sec;
+       seed[1] = now.tv_usec;
+       seed[2] = getpid ();
+-#ifdef G_OS_UNIX
+       seed[3] = getppid ();
+-#else
+-      seed[3] = 0;
+-#endif
+     }
++#else /* G_OS_WIN32 */
++  gint i;
++
++  for (i = 0; i < G_N_ELEMENTS (seed); i++)
++    rand_s (&seed[i]);
++#endif
+
+   return g_rand_new_with_seed_array (seed, 4);
+ }
+--
+cgit v0.10.1