Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package mate-session-manager

+  * debian/patches:
+    + Add 0006_util-Blacklist-some-session-specific-variables.patch. Fix
+      systemd-logind originated problems when unlocking screen saver.
+      (Closes: #986100). Thanks to Simon McVittie and Iain Lane for
+      digging into this.

-> Introduce a session env var blacklist so that not hightly session
specific env variables are not dumbly uploaded to systemd --user.

This resolves switching between GNOME and MATE back and forth. The cause
of the problem has been in MATE Session Manager.

In fact, Simon McVittie implemented a work around for this issue in
gnome-session 3.38.0-4. As he wrote in the referenced bug report, it is
always good to fix things on both ends.

[ Reason ]
Fix switching between GNOME and MATE on the MATE desktop's end.

[ Impact ]
As GNOME 3.38.0-4 has a work around for #986100, it will probably not
hurt if this fix enters Debian after the bullseye release. However,
technically the fix is a must have and the bug it fixes an RC bug for a
reason.

[ Tests ]
I downgraded gnome-session to 3.38.0-3 and tested mate-session-manager
1.24.1-1 (broken behaviour) and then mate-session-manager 1.24.1-2 (this
version, issue fixed). I then upgraded gnome-session to 3.38.0-4 (issue
still gone, as expected).

[ Risks ]
No known risk.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

[ Other info ]
None. Read #986100 for diving into the deeper details of this.

unblock mate-session-manager/1.24.1-2
diff -Nru mate-session-manager-1.24.1/debian/changelog 
mate-session-manager-1.24.1/debian/changelog
--- mate-session-manager-1.24.1/debian/changelog        2020-08-18 
14:30:25.000000000 +0200
+++ mate-session-manager-1.24.1/debian/changelog        2021-05-17 
00:11:38.000000000 +0200
@@ -1,3 +1,13 @@
+mate-session-manager (1.24.1-2) unstable; urgency=medium
+
+  * debian/patches:
+    + Add 0006_util-Blacklist-some-session-specific-variables.patch. Fix
+      systemd-logind originated problems when unlocking screen saver.
+      (Closes: #986100). Thanks to Simon McVittie and Iain Lane for
+      digging into this.
+
+ -- Mike Gabriel <sunwea...@debian.org>  Mon, 17 May 2021 00:11:38 +0200
+
 mate-session-manager (1.24.1-1) unstable; urgency=medium
 
   [ Martin Wimpress ]
diff -Nru 
mate-session-manager-1.24.1/debian/patches/0006_util-Blacklist-some-session-specific-variables.patch
 
mate-session-manager-1.24.1/debian/patches/0006_util-Blacklist-some-session-specific-variables.patch
--- 
mate-session-manager-1.24.1/debian/patches/0006_util-Blacklist-some-session-specific-variables.patch
        1970-01-01 01:00:00.000000000 +0100
+++ 
mate-session-manager-1.24.1/debian/patches/0006_util-Blacklist-some-session-specific-variables.patch
        2021-05-17 00:11:38.000000000 +0200
@@ -0,0 +1,73 @@
+From 29bd7ce251aa617d9f93c8ed95ee7ab49c8684ef Mon Sep 17 00:00:00 2001
+From: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
+Date: Mon, 17 May 2021 00:05:16 +0200
+Forwarded: https://github.com/mate-desktop/mate-session-manager/pull/282
+Subject: [PATCH] util: Blacklist some session-specific variables
+
+Things like XDG_SESSION_ID should not be uploaded to the environment.
+For example this is broken currently:
+
+  1. SSH to your machine
+  2. Log in to MATE Shell
+  3. Log out
+  4. Log in again
+  5. Lock the screen
+  6. Try to unlock
+
+You can't, and this is because the XDG_SESSION_ID from the first session
+(step 2) has leaked through to the second one (step 4), and so MATE
+Shell is listening to the `logind` `UnlockSession` signal for the wrong
+session. The SSH session established in step 1 serves to keep the
+`systemd --user` instance alive, so that the state is not torn down
+between logins.
+
+Original patch for GNOME by Iain Lane <ia...@gnome.org>.
+
+Patch ported over to MATE's session manager by Mike Gabriel
+<sunwea...@debian.org>.
+
+---
+ mate-session/gsm-util.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+--- a/mate-session/gsm-util.c
++++ b/mate-session/gsm-util.c
+@@ -38,6 +38,13 @@
+ 
+ static gchar *_saved_session_dir = NULL;
+ 
++static const char * const variable_blacklist[] = {
++    "XDG_SEAT",
++    "XDG_SESSION_ID",
++    "XDG_VTNR",
++    NULL
++};
++
+ char *
+ gsm_util_find_desktop_file_for_app_name (const char *name,
+                                          char      **autostart_dirs)
+@@ -509,6 +516,9 @@
+                 const char *entry_name = entry_names[i];
+                 const char *entry_value = g_getenv (entry_name);
+ 
++                if (g_strv_contains (variable_blacklist, entry_name))
++                    continue;
++
+                 if (!g_utf8_validate (entry_name, -1, NULL))
+                     continue;
+ 
+@@ -576,8 +586,13 @@
+                 return FALSE;
+         }
+ 
++        entries = g_get_environ ();
++
++        for (; variable_blacklist[i] != NULL; i++)
++                entries = g_environ_unsetenv (entries, variable_blacklist[i]);
++
+         g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
+-        for (entries = g_get_environ (); entries[i] != NULL; i++) {
++        for (i = 0; entries[i] != NULL; i++) {
+                 const char *entry = entries[i];
+ 
+                 if (!g_utf8_validate (entry, -1, NULL))
diff -Nru mate-session-manager-1.24.1/debian/patches/series 
mate-session-manager-1.24.1/debian/patches/series
--- mate-session-manager-1.24.1/debian/patches/series   2020-08-18 
14:28:43.000000000 +0200
+++ mate-session-manager-1.24.1/debian/patches/series   2021-05-17 
00:10:56.000000000 +0200
@@ -1 +1,2 @@
 0005_lock-session-before-user-switch.patch
+0006_util-Blacklist-some-session-specific-variables.patch

Reply via email to