summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2017-09-21 14:54:07 +1200
committerRobert Ancell <robert.ancell@canonical.com>2017-09-21 14:54:07 +1200
commit36569188decfe105f88743e2395f47b83b6e6f56 (patch)
treee015c2fbde8ec0fc01b77d9af294e893e28d1c76
parent3ecdddc8befcc0cd79a109aeec96344f487b1de3 (diff)
downloadlightdm-git-36569188decfe105f88743e2395f47b83b6e6f56.tar.gz
Fix timed autologins not using autologin-session when no session specified
-rw-r--r--src/seat.c7
-rw-r--r--tests/scripts/autologin-session-timeout.conf2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/seat.c b/src/seat.c
index ace2ad66..0b5df01b 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -1206,6 +1206,13 @@ greeter_start_session_cb (Greeter *greeter, SessionType type, const gchar *sessi
user = session_get_user (session);
if (user)
{
+ const gchar *autologin_username;
+
+ /* Override session for autologin if configured */
+ autologin_username = seat_get_string_property (seat, "autologin-user");
+ if (!session_name && g_strcmp0 (user_get_name (user), autologin_username) == 0)
+ session_name = seat_get_string_property (seat, "autologin-session");
+
if (!session_name)
session_name = user_get_xsession (user);
language = user_get_language (user);
diff --git a/tests/scripts/autologin-session-timeout.conf b/tests/scripts/autologin-session-timeout.conf
index 4675f63d..92a6fab3 100644
--- a/tests/scripts/autologin-session-timeout.conf
+++ b/tests/scripts/autologin-session-timeout.conf
@@ -39,7 +39,7 @@ autologin-session=alternative
#?GREETER-X-0 TERMINATE SIGNAL=15
# Session starts
-#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1
+#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=alternative NAME=alternative USER=have-password1
#?LOGIN1 ACTIVATE-SESSION SESSION=c1
#?XSERVER-0 ACCEPT-CONNECT
#?SESSION-X-0 CONNECT-XSERVER