summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiaoguang Wang <xwang@suse.com>2017-08-07 06:26:08 (GMT)
committerRay Strode <rstrode@redhat.com>2017-08-09 18:06:41 (GMT)
commit9bd3c5f04efc0da7de9fc27237244e22942ef720 (patch)
tree90cbf5ff10ec4a5df8c2748544a3282fe1795e89
parent84a28ade2c5a5272d6c9c9e1c99da64108b5b19b (diff)
downloadgdm-9bd3c5f04.zip
gdm-9bd3c5f04.tar.xz
gdm-{wayland,x}-session: omit GNOME_SHELL_SESSION_MODE from environment
After a user logs out, the systemd --user session may still be running (if, say, the user session was left around in the closing state, because of pulseaudio). If that happens, new user sessions will inherit the environment of previous sessions. Some of these environment variables are already intentionally pruned, DISPLAY, XAUTHORITY, WAYLAND_SOCKET, etc. One environment variable that isn't pruned, but should be, is GNOME_SHELL_SESSION_MODE. If it lingers, users could end up in classic mode even though they picked the non-classic mode from the gear menu. This commit adds GNOME_SHELL_SESSION_MODE to the list of environment variables to prune. (minor changes to original patch and commit message from Ray Strode) https://bugzilla.gnome.org/show_bug.cgi?id=785918
-rw-r--r--daemon/gdm-wayland-session.c1
-rw-r--r--daemon/gdm-x-session.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/daemon/gdm-wayland-session.c b/daemon/gdm-wayland-session.c
index efdb34e..742eb26 100644
--- a/daemon/gdm-wayland-session.c
+++ b/daemon/gdm-wayland-session.c
@@ -324,6 +324,7 @@ spawn_session (State *state,
g_subprocess_launcher_unsetenv (launcher, "XAUTHORITY");
g_subprocess_launcher_unsetenv (launcher, "WAYLAND_DISPLAY");
g_subprocess_launcher_unsetenv (launcher, "WAYLAND_SOCKET");
+ g_subprocess_launcher_unsetenv (launcher, "GNOME_SHELL_SESSION_MODE");
subprocess = g_subprocess_launcher_spawnv (launcher,
(const char * const *) argv,
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
index b919e6e..3ac4861 100644
--- a/daemon/gdm-x-session.c
+++ b/daemon/gdm-x-session.c
@@ -643,6 +643,8 @@ spawn_session (State *state,
g_subprocess_launcher_setenv (launcher, "WINDOWPATH", vt, TRUE);
}
+ g_subprocess_launcher_unsetenv (launcher, "GNOME_SHELL_SESSION_MODE");
+
if (run_script) {
subprocess = g_subprocess_launcher_spawn (launcher,
&error,