XDG_SESSION_ID from a previous Cinnamon or MATE session can cause GNOME screen unlock to fail
Commit 646b9bc0 (!21 (merged)) fixed a bug where a GNOME session would leak its XDG_SESSION_ID
into the activation environment of a second GNOME session as the same user. Unfortunately, the forks of gnome-session used in Cinnamon and MATE do not have 646b9bc0 and can trigger a similar symptom in a subsequent GNOME session.
To reproduce (adapted from @iainl's steps to reproduce the bug fixed by 646b9bc0):
- Make sure a test user's
systemd --user
will not exit immediately on logout, for example with any of these:- Have a ssh session open for the test user and leave it logged in throughout the remaining steps
- Configure systemd-logind with
KillUserProcesses=no
- Run on Debian, where
KillUserProcesses=no
is currently the default to avoid breakingscreen
andtmux
- Log in to Cinnamon or MATE
- Log out
- Quickly (timing might matter) log back in as the same user, this time choosing GNOME before entering the password. I'm using GNOME 3.38 (Debian 11 prerelease) but I think GNOME 40 will still have this.
- Lock the screen
- Try to unlock
Unlocking fails, because the XDG_SESSION_ID
from the first session (step 2) has leaked through to the second one (step 4), and so GNOME Shell is listening to the logind
UnlockSession
signal for the wrong session.
I think this is really a bug in Cinnamon and MATE, but because the symptom appears in GNOME and looks like a GNOME bug, I think it would be best to fix it at both ends. I'm testing a gnome-session change.