summaryrefslogtreecommitdiff
path: root/src/seat-xlocal.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2014-09-01 17:01:15 +1200
committerRobert Ancell <robert.ancell@canonical.com>2014-09-01 17:01:15 +1200
commit8c4d5ec04b68b27fdfd790f96d38deca8ef4654c (patch)
tree893585f779a98a8e21533529400492cc1bc30c47 /src/seat-xlocal.c
parentbf92a44ecc75145df1c3c1e0295269a7492bca1c (diff)
downloadlightdm-8c4d5ec04b68b27fdfd790f96d38deca8ef4654c.tar.gz
Don't assume display server is an X server when running scripts - fixes crashes running scripts under Mir
Diffstat (limited to 'src/seat-xlocal.c')
-rw-r--r--src/seat-xlocal.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/seat-xlocal.c b/src/seat-xlocal.c
index e0bd08e7..9fa9f683 100644
--- a/src/seat-xlocal.c
+++ b/src/seat-xlocal.c
@@ -343,10 +343,13 @@ seat_xlocal_run_script (Seat *seat, DisplayServer *display_server, Process *scri
const gchar *path;
XServerLocal *x_server;
- x_server = X_SERVER_LOCAL (display_server);
- path = x_server_local_get_authority_file_path (x_server);
- process_set_env (script, "DISPLAY", x_server_get_address (X_SERVER (x_server)));
- process_set_env (script, "XAUTHORITY", path);
+ if (IS_X_SERVER_LOCAL (display_server))
+ {
+ x_server = X_SERVER_LOCAL (display_server);
+ path = x_server_local_get_authority_file_path (x_server);
+ process_set_env (script, "DISPLAY", x_server_get_address (X_SERVER (x_server)));
+ process_set_env (script, "XAUTHORITY", path);
+ }
SEAT_CLASS (seat_xlocal_parent_class)->run_script (seat, display_server, script);
}