summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2010-10-24 20:18:30 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2010-10-24 20:18:30 +0000
commit07fea48c21b54aba4c06e29100667c8acc24c9f5 (patch)
treef6d652b7da5581de82ce035616e84a6a01026eab /xfce-base/xfce4-session/files
parentadd ~arm, bug #341031 (diff)
downloadhistorical-07fea48c21b54aba4c06e29100667c8acc24c9f5.tar.gz
historical-07fea48c21b54aba4c06e29100667c8acc24c9f5.tar.bz2
historical-07fea48c21b54aba4c06e29100667c8acc24c9f5.zip
Fix gnome-keyring initialization wrt #296606 by Michał Górny.
Package-Manager: portage-2.2.0_alpha1/cvs/Linux x86_64
Diffstat (limited to 'xfce-base/xfce4-session/files')
-rw-r--r--xfce-base/xfce4-session/files/xfce4-session-4.7.0-gnome-keyring.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/xfce-base/xfce4-session/files/xfce4-session-4.7.0-gnome-keyring.patch b/xfce-base/xfce4-session/files/xfce4-session-4.7.0-gnome-keyring.patch
new file mode 100644
index 000000000000..72bd990d162e
--- /dev/null
+++ b/xfce-base/xfce4-session/files/xfce4-session-4.7.0-gnome-keyring.patch
@@ -0,0 +1,94 @@
+From f32cd3e21c9d557cc8fab23b7c59baff36b16a9a Mon Sep 17 00:00:00 2001
+From: Jérôme Guelfucci <jeromeg@xfce.org>
+Date: Sun, 24 Oct 2010 20:01:47 +0000
+Subject: Add support for new gnome-keyring (Luca Niccoli).
+
+This fixes bugs #5912, #5137 and #6073. Support for old gnome-keyring
+versions is dropped with this commit.
+---
+diff --git a/xfce4-session/xfsm-compat-gnome.c b/xfce4-session/xfsm-compat-gnome.c
+index 62f1452..3ed79b3 100644
+--- a/xfce4-session/xfsm-compat-gnome.c
++++ b/xfce4-session/xfsm-compat-gnome.c
+@@ -104,27 +104,15 @@ child_setup (gpointer user_data)
+ static void
+ gnome_keyring_daemon_startup (void)
+ {
+- const char *old_keyring;
+-
+ GError *error = NULL;
+ gchar *sout;
+ gchar **lines;
++ gsize lineno;
+ gint status;
+ long pid;
+ gchar *pid_str;
+ gchar *end;
+- char *argv[2];
+-
+- /* If there is already a working keyring, don't start a new daemon */
+- old_keyring = g_getenv ("GNOME_KEYRING_SOCKET");
+- if (old_keyring != NULL && access (old_keyring, R_OK | W_OK) == 0)
+- {
+-#ifdef HAVE_GNOME_KEYRING
+- gnome_keyring_daemon_prepare_environment_sync ();
+-#endif
+- return;
+- }
+-
++ char *argv[3];
+
+ /* Pipe to slave keyring lifetime to */
+ if (pipe (keyring_lifetime_pipe))
+@@ -135,8 +123,10 @@ gnome_keyring_daemon_startup (void)
+
+ error = NULL;
+ argv[0] = GNOME_KEYRING_DAEMON;
+- argv[1] = NULL;
+- g_spawn_sync (NULL, argv, NULL, G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
++ argv[1] = "--start";
++ argv[2] = NULL;
++ g_spawn_sync (NULL, argv, NULL,
++ G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
+ child_setup, NULL,
+ &sout, NULL, &status, &error);
+
+@@ -154,20 +144,22 @@ gnome_keyring_daemon_startup (void)
+ {
+ if (WIFEXITED (status) && WEXITSTATUS (status) == 0 && sout != NULL)
+ {
+- lines = g_strsplit (sout, "\n", 3);
+-
+- if (lines[0] != NULL && lines[1] != NULL
+- && g_str_has_prefix (lines[1], "GNOME_KEYRING_PID="))
+- {
+- pid_str = lines[1] + strlen ("GNOME_KEYRING_PID=");
+- pid = strtol (pid_str, &end, 10);
+-
+- if (end != pid_str)
+- {
+- gnome_keyring_daemon_pid = pid;
+- xfce_putenv (lines[0]);
+- }
+- }
++ lines = g_strsplit (sout, "\n", 0);
++
++ for (lineno = 0; lines[lineno] != NULL; lineno++)
++ {
++ xfce_putenv (lines[lineno]);
++
++ if (g_str_has_prefix (lines[lineno], "GNOME_KEYRING_PID="))
++ {
++ pid_str = lines[lineno] + strlen ("GNOME_KEYRING_PID=");
++ pid = strtol (pid_str, &end, 10);
++ if (end != pid_str)
++ {
++ gnome_keyring_daemon_pid = pid;
++ }
++ }
++ }
+
+ g_strfreev (lines);
+
+--
+cgit v0.8.3.4