Date: Monday, April 29, 2013 @ 07:42:36
  Author: foutrelis
Revision: 183870

upgpkg: xfce4-session 4.10.0-7

Add upstream fixes to avoid crashes with glib 2.36.

Added:
  xfce4-session/trunk/xfce4-session-4.10.0-store-the-watch-function-id.patch
  
xfce4-session/trunk/xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch
Modified:
  xfce4-session/trunk/PKGBUILD

-----------------------------------------------------------------+
 PKGBUILD                                                        |   22 ++
 xfce4-session-4.10.0-store-the-watch-function-id.patch          |   26 +++
 xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch |   79 
++++++++++
 3 files changed, 123 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2013-04-28 21:05:12 UTC (rev 183869)
+++ PKGBUILD    2013-04-29 05:42:36 UTC (rev 183870)
@@ -4,7 +4,7 @@
 
 pkgname=xfce4-session
 pkgver=4.10.0
-pkgrel=6
+pkgrel=7
 pkgdesc="A session manager for Xfce"
 arch=('i686' 'x86_64')
 url="http://www.xfce.org/";
@@ -21,18 +21,32 @@
 options=('!libtool')
 install=$pkgname.install
 source=(http://archive.xfce.org/src/xfce/$pkgname/4.10/$pkgname-$pkgver.tar.bz2
-        xfce4-session-4.10.0-add-systemd-support.patch)
+        xfce4-session-4.10.0-add-systemd-support.patch
+        xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch
+        xfce4-session-4.10.0-store-the-watch-function-id.patch)
 sha256sums=('bb8aa9a74c3d382840596fb4875144d66c7f3f47c8e9ee81d31e3428a72c46ce'
-            'ffae61c48a4bd0cb51d422cb93f2de9567abaf29085370c455ef349b6a10234b')
+            'ffae61c48a4bd0cb51d422cb93f2de9567abaf29085370c455ef349b6a10234b'
+            '18ed175dd4242e39161a093045c6c6aebf9a408350652bde1454fe07411cdf3c'
+            '5eb5319a38f58a2d518d0e3d24b6d01c487871711fb36b55cb03a10a4591cdcf')
 
-build() {
+prepare() {
   cd "$srcdir/$pkgname-$pkgver"
 
   # https://bugzilla.xfce.org/show_bug.cgi?id=8729
   patch -Np1 -i "$srcdir/xfce4-session-4.10.0-add-systemd-support.patch"
 
+  # https://bugzilla.xfce.org/show_bug.cgi?id=9709
+  patch -Np1 -i 
"$srcdir/xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch"
+  patch -Np1 -i 
"$srcdir/xfce4-session-4.10.0-store-the-watch-function-id.patch"
+
+  sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in
+
   xdt-autogen
+}
 
+build() {
+  cd "$srcdir/$pkgname-$pkgver"
+
   ./configure \
     --prefix=/usr \
     --sysconfdir=/etc \

Added: xfce4-session-4.10.0-store-the-watch-function-id.patch
===================================================================
--- xfce4-session-4.10.0-store-the-watch-function-id.patch                      
        (rev 0)
+++ xfce4-session-4.10.0-store-the-watch-function-id.patch      2013-04-29 
05:42:36 UTC (rev 183870)
@@ -0,0 +1,26 @@
+From ab391138cacc62ab184a338e237c4430356b41f9 Mon Sep 17 00:00:00 2001
+From: Nick Schermer <n...@xfce.org>
+Date: Fri, 26 Apr 2013 18:05:10 +0000
+Subject: Store the watch function id to avoid possible double free (bug #9709).
+
+---
+diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c
+index e43c53c..c621397 100644
+--- a/xfce4-session/xfsm-startup.c
++++ b/xfce4-session/xfsm-startup.c
+@@ -903,9 +903,10 @@ xfsm_startup_start_properties (XfsmProperties *properties,
+   child_watch_data = g_new0 (XfsmStartupData, 1);
+   child_watch_data->manager = g_object_ref (manager);
+   child_watch_data->properties = properties;
+-  g_child_watch_add_full (G_PRIORITY_LOW, properties->pid,
+-                          xfsm_startup_child_watch, child_watch_data,
+-                          (GDestroyNotify) xfsm_startup_data_free);
++  child_watch_data->properties->child_watch_id =
++      g_child_watch_add_full (G_PRIORITY_LOW, properties->pid,
++                              xfsm_startup_child_watch, child_watch_data,
++                              (GDestroyNotify) xfsm_startup_data_free);
+ 
+   /* set a timeout -- client must register in a a certain amount of time
+    * or it's assumed to be broken/have issues. */
+--
+cgit v0.9.1

Added: xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch
===================================================================
--- xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch             
                (rev 0)
+++ xfce4-session-4.10.0-use-the-async-spawn-function-of-glib.patch     
2013-04-29 05:42:36 UTC (rev 183870)
@@ -0,0 +1,79 @@
+From dee0200fa5dc4de064f288281ddd13199ba7fcde Mon Sep 17 00:00:00 2001
+From: Nick Schermer <n...@xfce.org>
+Date: Fri, 26 Apr 2013 17:46:29 +0000
+Subject: Use the async spawn function of glib.
+
+---
+diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c
+index 911eec6..e43c53c 100644
+--- a/xfce4-session/xfsm-startup.c
++++ b/xfce4-session/xfsm-startup.c
+@@ -864,6 +864,7 @@ xfsm_startup_start_properties (XfsmProperties *properties,
+   gint             n;
+   const gchar     *current_directory;
+   GPid             pid;
++  GError          *error = NULL;
+ 
+   /* release any possible old resources related to a previous startup */
+   xfsm_properties_set_default_child_watch (properties);
+@@ -878,44 +879,28 @@ xfsm_startup_start_properties (XfsmProperties 
*properties,
+ 
+   current_directory = xfsm_properties_get_string (properties, 
SmCurrentDirectory);
+ 
+-  /* fork a new process for the application */
+-#ifdef HAVE_VFORK
+-  /* vfork() doesn't allow you to do anything but call exec*() or _exit(),
+-   * so if we need to set the working directory, we can't use vfork() */
+-  if (current_directory == NULL)
+-    pid = vfork ();
+-  else
+-#endif
+-    pid = fork ();
+-
+-  /* handle the child process */
+-  if (pid == 0)
++  if (!g_spawn_async (current_directory,
++                      argv, NULL,
++                      G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
++                      NULL, NULL,
++                      &pid, &error))
+     {
+-      /* execute the application here */
+-      if (current_directory)
+-        {
+-          if (chdir (current_directory))
+-            g_warning ("Unable to chdir to \"%s\": %s", current_directory, 
strerror (errno));
+-        }
+-      execvp (argv[0], argv);
+-      _exit (127);
+-    }
+-
+-  /* cleanup */
+-  g_strfreev (argv);
++      g_warning ("Unable to launch \"%s\": %s",
++                 *argv, error->message);
++      g_error_free (error);
++      g_strfreev (argv);
+ 
+-  /* check if we failed to fork */
+-  if (G_UNLIKELY (pid < 0))
+-    {
+-      /* tell the user that we failed to fork */
+-      perror ("Failed to fork new process");
+       return FALSE;
+     }
+ 
++  xfsm_verbose ("Launched command \"%s\" with PID %dn", *argv, (gint) pid);
++
++  g_strfreev (argv);
++
+   properties->pid = pid;
+ 
+   /* set a watch to make sure the child doesn't quit before registering */
+-  child_watch_data = g_new (XfsmStartupData, 1);
++  child_watch_data = g_new0 (XfsmStartupData, 1);
+   child_watch_data->manager = g_object_ref (manager);
+   child_watch_data->properties = properties;
+   g_child_watch_add_full (G_PRIORITY_LOW, properties->pid,
+--
+cgit v0.9.1

Reply via email to