diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2018-01-11 16:32:35 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2018-01-15 14:22:58 +1300 |
commit | 523431b0bbe3d2a495e52ca8bd52d8511919e781 (patch) | |
tree | f31de2ee951053b7221877c189c447e2e4e630f8 | |
parent | 327a4efb73532fbe46c441d8ce59ddcc0ba591e7 (diff) | |
download | lightdm-git-523431b0bbe3d2a495e52ca8bd52d8511919e781.tar.gz |
Fix LightDM failing to start greeters on remote X servers.
This change caused the VNC support to break, so contains some logic
fixes for that.
-rw-r--r-- | src/seat.c | 11 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/scripts/xremote-login-logout.conf | 60 | ||||
-rwxr-xr-x | tests/test-xremote-login-logout | 2 |
4 files changed, 69 insertions, 6 deletions
@@ -640,11 +640,6 @@ session_stopped_cb (Session *session, Seat *seat) } display_server = session_get_display_server (session); - if (!display_server) - { - g_object_unref (session); - return; - } /* Cleanup */ if (!IS_GREETER (session)) @@ -1300,7 +1295,7 @@ seat_switch_to_greeter (Seat *seat) g_return_val_if_fail (seat != NULL, FALSE); - if (!seat_get_can_switch (seat)) + if (!seat_get_can_switch (seat) && seat->priv->sessions != NULL) return FALSE; /* Switch to greeter if one open (shouldn't be though) */ @@ -1321,6 +1316,10 @@ seat_switch_to_greeter (Seat *seat) seat->priv->session_to_activate = g_object_ref (greeter_session); display_server = create_display_server (seat, SESSION (greeter_session)); + if (!display_server) { + g_clear_object (&seat->priv->session_to_activate); + return FALSE; + } session_set_display_server (SESSION (greeter_session), display_server); if (!display_server_start (display_server)) return FALSE; diff --git a/tests/Makefile.am b/tests/Makefile.am index f28f2e5c..81299eea 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -163,6 +163,7 @@ TESTS = \ test-vnc-guest \ test-xremote-autologin \ test-xremote-login \ + test-xremote-login-logout \ test-xdmcp-client \ test-xdmcp-client-xorg-1.16 \ test-xdmcp-server-autologin \ @@ -597,6 +598,7 @@ EXTRA_DIST = \ scripts/xdmcp-server-xdm-authentication-short-data.conf \ scripts/xremote-autologin.conf \ scripts/xremote-login.conf \ + scripts/xremote-login-logout.conf \ scripts/xserver-config.conf \ scripts/xserver-fail-start.conf \ scripts/xserver-no-share.conf diff --git a/tests/scripts/xremote-login-logout.conf b/tests/scripts/xremote-login-logout.conf new file mode 100644 index 00000000..2dee5653 --- /dev/null +++ b/tests/scripts/xremote-login-logout.conf @@ -0,0 +1,60 @@ +# +# Check logging out with a remote X server switches back to a greeter +# + +[SeatDefaults] +type=xremote +user-session=default +xserver-hostname=127.0.0.1 +xserver-display-number=98 + +# Start a remote X server to use +#?*START-XSERVER ARGS=":98 -listen tcp" +#?XSERVER-98 START LISTEN-TCP + +#?*START-DAEMON +#?RUNNER DAEMON-START + +# LightDM connects to X server +#?XSERVER-98 ACCEPT-CONNECT + +# Greeter starts +#?GREETER-X-127.0.0.1:98 START XDG_SEAT=seat0 XDG_SESSION_CLASS=greeter +#?LOGIN1 ACTIVATE-SESSION SESSION=c0 +#?XSERVER-98 ACCEPT-CONNECT +#?GREETER-X-127.0.0.1:98 CONNECT-XSERVER +#?GREETER-X-127.0.0.1:98 CONNECT-TO-DAEMON +#?GREETER-X-127.0.0.1:98 CONNECTED-TO-DAEMON + +# Log into account with a password +#?*GREETER-X-127.0.0.1:98 AUTHENTICATE USERNAME=have-password1 +#?GREETER-X-127.0.0.1:98 SHOW-PROMPT TEXT="Password:" +#?*GREETER-X-127.0.0.1:98 RESPOND TEXT="password" +#?GREETER-X-127.0.0.1:98 AUTHENTICATION-COMPLETE USERNAME=have-password1 AUTHENTICATED=TRUE +#?*GREETER-X-127.0.0.1:98 START-SESSION +#?GREETER-X-127.0.0.1:98 TERMINATE SIGNAL=15 + +# Session starts +#?SESSION-X-127.0.0.1:98 START XDG_SEAT=seat0 DESKTOP_SESSION=default USER=have-password1 +#?LOGIN1 ACTIVATE-SESSION SESSION=c1 +#?XSERVER-98 ACCEPT-CONNECT +#?SESSION-X-127.0.0.1:98 CONNECT-XSERVER + +# Logout session +#?*SESSION-X-127.0.0.1:98 LOGOUT + +# LightDM connects to X server +#?XSERVER-98 ACCEPT-CONNECT + +# Greeter starts +#?GREETER-X-127.0.0.1:98 START XDG_SEAT=seat0 XDG_SESSION_CLASS=greeter +#?LOGIN1 ACTIVATE-SESSION SESSION=c2 +#?XSERVER-98 ACCEPT-CONNECT +#?GREETER-X-127.0.0.1:98 CONNECT-XSERVER +#?GREETER-X-127.0.0.1:98 CONNECT-TO-DAEMON +#?GREETER-X-127.0.0.1:98 CONNECTED-TO-DAEMON + +# Cleanup +#?*STOP-DAEMON +#?GREETER-X-127.0.0.1:98 TERMINATE SIGNAL=15 +#?RUNNER DAEMON-EXIT STATUS=0 diff --git a/tests/test-xremote-login-logout b/tests/test-xremote-login-logout new file mode 100755 index 00000000..37698e1e --- /dev/null +++ b/tests/test-xremote-login-logout @@ -0,0 +1,2 @@ +#!/bin/sh +./src/dbus-env ./src/test-runner xremote-login-logout test-gobject-greeter |