]> git.pld-linux.org Git - packages/xfce4-session.git/commitdiff
- added patches to fix glib2 crashes in xfce4-sesssion, auto/th/xfce4-session-4.10.0-5
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 28 Apr 2013 20:06:44 +0000 (22:06 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 28 Apr 2013 20:06:44 +0000 (22:06 +0200)
see https://bugzilla.xfce.org/show_bug.cgi?id=9709
- rel 5

0001-Use-the-async-spawn-function-of-glib.patch [new file with mode: 0644]
0002-Store-the-watch-function-id-to-avoid-possible-double.patch [new file with mode: 0644]
xfce4-session.spec

diff --git a/0001-Use-the-async-spawn-function-of-glib.patch b/0001-Use-the-async-spawn-function-of-glib.patch
new file mode 100644 (file)
index 0000000..5e154f2
--- /dev/null
@@ -0,0 +1,83 @@
+From dee0200fa5dc4de064f288281ddd13199ba7fcde Mon Sep 17 00:00:00 2001
+From: Nick Schermer <nick@xfce.org>
+Date: Fri, 26 Apr 2013 19:46:29 +0200
+Subject: Use the async spawn function of glib.
+
+---
+ xfce4-session/xfsm-startup.c | 45 +++++++++++++++-----------------------------
+ 1 file changed, 15 insertions(+), 30 deletions(-)
+
+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,
+-- 
+1.8.1
+
diff --git a/0002-Store-the-watch-function-id-to-avoid-possible-double.patch b/0002-Store-the-watch-function-id-to-avoid-possible-double.patch
new file mode 100644 (file)
index 0000000..7b43f79
--- /dev/null
@@ -0,0 +1,31 @@
+From ab391138cacc62ab184a338e237c4430356b41f9 Mon Sep 17 00:00:00 2001
+From: Nick Schermer <nick@xfce.org>
+Date: Fri, 26 Apr 2013 20:05:10 +0200
+Subject: Store the watch function id to avoid possible double free (bug
+ #9709).
+
+---
+ xfce4-session/xfsm-startup.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+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. */
+-- 
+1.8.1
+
index 9e9c4255576baa8916748a0a607d6b736bf408aa..5dc66943c0b5f8b6a98d4a669df029293ff51f29 100644 (file)
@@ -6,7 +6,7 @@ Summary:        Xfce session manager
 Summary(pl.UTF-8):     Zarządca sesji Xfce
 Name:          xfce4-session
 Version:       4.10.0
-Release:       4
+Release:       5
 License:       GPL v2
 Group:         X11/Applications
 Source0:       http://archive.xfce.org/xfce/4.10/src/%{name}-%{version}.tar.bz2
@@ -17,6 +17,8 @@ Patch0:               %{name}-ubuntu_icons.patch
 Patch1:                %{name}-session-save.patch
 Patch2:                %{name}-add-systemd-support.patch
 Patch3:                am.patch
+Patch4:                0001-Use-the-async-spawn-function-of-glib.patch
+Patch5:                0002-Store-the-watch-function-id-to-avoid-possible-double.patch
 URL:           http://www.xfce.org/projects/xfce4-session
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -30,7 +32,9 @@ BuildRequires:        libwnck2-devel >= 2.22.0
 BuildRequires: libxfce4ui-devel >= %{version}
 BuildRequires: libxfce4util-devel >= %{version}
 BuildRequires: pkgconfig
+BuildRequires: polkit-devel
 BuildRequires: rpmbuild(macros) >= 1.601
+BuildRequires: systemd-devel
 BuildRequires: xfce4-dev-tools >= 4.10.0
 BuildRequires: xfconf-devel >= %{version}
 BuildRequires: xorg-lib-libSM-devel
@@ -93,6 +97,8 @@ Statyczna biblioteka zarządcy sesji dla środowiska Xfce.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 %{__intltoolize}
This page took 0.152226 seconds and 4 git commands to generate.