Skip to content
Snippets Groups Projects
Commit 704a4db4 authored by Brad Fanella's avatar Brad Fanella
Browse files

Updated to version 1.22.3

parent 561a821b
No related branches found
Tags 1.22.3-1
No related merge requests found
......@@ -2,8 +2,8 @@
# Contributor: Martin Wimpress <code@flexion.org>
pkgname=mate-session-manager
pkgver=1.22.2
pkgrel=2
pkgver=1.22.3
pkgrel=1
pkgdesc="The MATE Session Handler"
url="https://mate-desktop.org"
arch=('x86_64')
......@@ -15,18 +15,8 @@ optdepends=('gnome-keyring: keyring support'
groups=('mate')
conflicts=('mate-session-manager-gtk3')
replaces=('mate-session-manager-gtk3')
source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"
"gnome-keyring-3.34.patch")
sha256sums=('a814b07cbd42920ab86fe77c40f3e1ce7118cbc5da3251b1eb2ab9aa974c0aec'
'f3ca47a508523e1ed346d224cf236870190204943b4a0cdab967d37fe04bde8e')
prepare() {
cd "${pkgname}-${pkgver}"
# Fix timeout with gnome-keyring 3.34
# https://github.com/mate-desktop/mate-session-manager/pull/223
patch -Np1 -i ../gnome-keyring-3.34.patch
}
source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz")
sha256sums=('8908089782781d692b876ddfd783aea8ddd89f7f626c3499be81f6729c3242fb')
build() {
cd "${pkgname}-${pkgver}"
......
From 8bcc7153e0ef5aeb5fb276350c7015579f6e432a Mon Sep 17 00:00:00 2001
From: Jindrich Makovicka <makovick@gmail.com>
Date: Sun, 6 Oct 2019 10:35:46 +0200
Subject: [PATCH 1/2] Remove GNOME_KEYRING_LIFETIME_FD
Keyring lifetime fd was removed from gnome-keyring in 2009
See "[daemon] Use new control protocol for daemon."
---
mate-session/msm-gnome.c | 35 ++---------------------------------
1 file changed, 2 insertions(+), 33 deletions(-)
diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
index 5e9cf02..97e08b8 100644
--- a/mate-session/msm-gnome.c
+++ b/mate-session/msm-gnome.c
@@ -48,29 +48,9 @@
static gboolean gnome_compat_started = FALSE;
-static int keyring_lifetime_pipe[2];
static pid_t gnome_keyring_daemon_pid = 0;
static Window gnome_smproxy_window = None;
-static void
-child_setup (gpointer user_data)
-{
- gint open_max;
- gint fd;
- char *fd_str;
-
- open_max = sysconf (_SC_OPEN_MAX);
- for (fd = 3; fd < open_max; fd++)
- {
- if (fd != keyring_lifetime_pipe[0])
- fcntl (fd, F_SETFD, FD_CLOEXEC);
- }
-
- fd_str = g_strdup_printf ("%d", keyring_lifetime_pipe[0]);
- g_setenv ("GNOME_KEYRING_LIFETIME_FD", fd_str, TRUE);
- g_free (fd_str);
-}
-
static void
gnome_keyring_daemon_startup (void)
@@ -87,26 +67,15 @@ gnome_keyring_daemon_startup (void)
gchar *name;
const gchar *value;
- /* Pipe to slave keyring lifetime to */
- if (pipe (keyring_lifetime_pipe))
- {
- g_warning ("Failed to set up pipe for gnome-keyring: %s", strerror (errno));
- return;
- }
-
error = NULL;
argv[0] = GNOME_KEYRING_DAEMON;
argv[1] = "--start";
argv[2] = NULL;
g_spawn_sync (NULL, argv, NULL,
- G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
- child_setup, NULL,
+ G_SPAWN_SEARCH_PATH,
+ NULL, NULL,
&sout, NULL, &status, &error);
- close (keyring_lifetime_pipe[0]);
- /* We leave keyring_lifetime_pipe[1] open for the lifetime of the session,
- in order to slave the keyring daemon lifecycle to the session. */
-
if (error != NULL)
{
g_printerr ("Failed to run gnome-keyring-daemon: %s\n",
From 023f6f7b69b2a9c0399d7737d7729d464f9671e5 Mon Sep 17 00:00:00 2001
From: Jindrich Makovicka <makovick@gmail.com>
Date: Sun, 6 Oct 2019 10:38:05 +0200
Subject: [PATCH 2/2] Fix timeout with gnome-keyring 3.34
Launch gnome-keyring-daemon asynchronously, and remove the
GNOME_KEYRING_PID reading code.
GNOME_KEYRING_PID exposure was removed from gnome-keyring in 2014.
---
mate-session/msm-gnome.c | 85 ++++++++++------------------------------
1 file changed, 20 insertions(+), 65 deletions(-)
diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
index 97e08b8..b43f1ad 100644
--- a/mate-session/msm-gnome.c
+++ b/mate-session/msm-gnome.c
@@ -48,88 +48,46 @@
static gboolean gnome_compat_started = FALSE;
-static pid_t gnome_keyring_daemon_pid = 0;
static Window gnome_smproxy_window = None;
+static void
+gnome_keyring_daemon_finished (GPid pid,
+ gint status,
+ gpointer user_data)
+{
+ if (WEXITSTATUS (status) != 0)
+ {
+ /* daemon failed for some reason */
+ g_printerr ("gnome-keyring-daemon failed to start correctly, "
+ "exit code: %d\n", WEXITSTATUS (status));
+ }
+}
static void
gnome_keyring_daemon_startup (void)
{
GError *error = NULL;
- gchar *sout;
- gchar **lines;
- gsize lineno;
- gint status;
- glong pid;
- gchar *end;
+ GPid pid;
gchar *argv[3];
- gchar *p;
- gchar *name;
- const gchar *value;
error = NULL;
argv[0] = GNOME_KEYRING_DAEMON;
argv[1] = "--start";
argv[2] = NULL;
- g_spawn_sync (NULL, argv, NULL,
- G_SPAWN_SEARCH_PATH,
- NULL, NULL,
- &sout, NULL, &status, &error);
+ g_spawn_async (NULL, argv, NULL,
+ G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
+ NULL, NULL, &pid,
+ &error);
if (error != NULL)
{
- g_printerr ("Failed to run gnome-keyring-daemon: %s\n",
+ g_printerr ("Failed to spawn gnome-keyring-daemon: %s\n",
error->message);
g_error_free (error);
+ return;
}
- else
- {
- if (WIFEXITED (status) && WEXITSTATUS (status) == 0 && sout != NULL)
- {
- lines = g_strsplit (sout, "\n", 0);
-
- for (lineno = 0; lines[lineno] != NULL; lineno++)
- {
- p = strchr (lines[lineno], '=');
- if (p == NULL)
- continue;
-
- name = g_strndup (lines[lineno], p - lines[lineno]);
- value = p + 1;
-
- g_setenv (name, value, TRUE);
-
- if (g_strcmp0 (name, "GNOME_KEYRING_PID") == 0)
- {
- pid = strtol (value, &end, 10);
- if (end != value)
- gnome_keyring_daemon_pid = pid;
- }
-
- g_free (name);
- }
-
- g_strfreev (lines);
- }
- else
- {
- /* daemon failed for some reason */
- g_printerr ("gnome-keyring-daemon failed to start correctly, "
- "exit code: %d\n", WEXITSTATUS (status));
- }
-
- g_free (sout);
- }
-}
-static void
-gnome_keyring_daemon_shutdown (void)
-{
- if (gnome_keyring_daemon_pid != 0)
- {
- kill (gnome_keyring_daemon_pid, SIGTERM);
- gnome_keyring_daemon_pid = 0;
- }
+ g_child_watch_add (pid, gnome_keyring_daemon_finished, NULL);
}
@@ -232,9 +190,6 @@ msm_gnome_stop (void)
g_debug ("MsmGnome: stopping");
- /* shutdown the keyring daemon */
- gnome_keyring_daemon_shutdown ();
-
msm_compat_gnome_smproxy_shutdown ();
gnome_compat_started = FALSE;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment