summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-01-04 11:09:55 -0500
committerRay Strode <rstrode@redhat.com>2018-01-08 13:28:32 -0500
commit5dd631c9d5dbb1dc8e548c3dc6a21ef656f44944 (patch)
tree2e1d7a96371ef658c80d78f41527e96965878804 /common
parentbcd60d76c15e680637aa7d733b9b9052f64db497 (diff)
downloadgdm-5dd631c9d5dbb1dc8e548c3dc6a21ef656f44944.tar.gz
common: don't run scripts with bogus DISPLAY and XAUTHORITY
DISPLAY and XAUTHORITY might not be set if we're starting the X server as part of the session. In that case we should ensure the variables aren't set in the environment of the gdm session scripts. This commit fixes that. https://bugzilla.gnome.org/show_bug.cgi?id=792150
Diffstat (limited to 'common')
-rw-r--r--common/gdm-common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/gdm-common.c b/common/gdm-common.c
index 31fc810a..c4fc7073 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -594,8 +594,13 @@ gdm_get_script_environment (const char *username,
}
/* Runs as root */
- g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (display_x11_authority_file));
- g_hash_table_insert (hash, g_strdup ("DISPLAY"), g_strdup (display_name));
+ if (display_x11_authority_file) {
+ g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (display_x11_authority_file));
+ }
+
+ if (display_name) {
+ g_hash_table_insert (hash, g_strdup ("DISPLAY"), g_strdup (display_name));
+ }
g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (GDM_SESSION_DEFAULT_PATH));
g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));