util: Blacklist some session-specific variables#282
Open
sunweaver wants to merge 1 commit intomate-desktop:masterfrom
Open
util: Blacklist some session-specific variables#282sunweaver wants to merge 1 commit intomate-desktop:masterfrom
sunweaver wants to merge 1 commit intomate-desktop:masterfrom
Conversation
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 <iainl@gnome.org>. Patch ported over to MATE's session manager by Mike Gabriel <sunweaver@debian.org>. Fixes mate-desktop#271
Member
Author
|
@raveit65 This PR has a failing CI build. However, this does not look like a PR / patch problem. |
Vladimir-csp
added a commit
to Vladimir-csp/uwsm
that referenced
this pull request
Nov 28, 2025
…vironment In future releases the following variables will be omitted: XDG_VTNR, XDG_SESSION_ID, XDG_SESSION_PATH, XDG_SEAT, XDG_SEAT_PATH. These are transient variables that make sense only for a specific session among others (graphical or otherwise) and should not be placed in activation environment. This is in contrast to vars like XDG_CURERNT_DESKTOP which are relevant to one and only graphical session and may inform other sessions and environments on what's going on there. The problem though is that those vars are useful to have at hand. This commit creates alternative way of propagaitng them to compositor and further: * compositor's service `EnvironmentFile=` directive and a file for it. * `uwsm app` now transmits them via `--setenv` arg to service units it launches. Currently overall behavior is unchanged by default, the new mechanism is redundant. In future releases these vars will be moved from `always_export` set to `never_export` and `always_unset` sets. This behavior can be tested by adding `UWSM_NO_SESSION_SPECIFIC_VARS=true` directly to activation environment before `uwsm start`. Reference for var exclusion in GNOME and MATE session managers: https://gitlab.gnome.org/GNOME/gnome-session/-/issues/86 mate-desktop/mate-session-manager#282
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Things like XDG_SESSION_ID should not be uploaded to the environment.
For example this is broken currently:
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
logindUnlockSessionsignal for the wrongsession. The SSH session established in step 1 serves to keep the
systemd --userinstance alive, so that the state is not torn downbetween logins.
Original patch for GNOME by Iain Lane iainl@gnome.org.
Patch ported over to MATE's session manager by Mike Gabriel
sunweaver@debian.org.
Fixes #271