summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2017-09-21 14:41:48 +1200
committerRobert Ancell <robert.ancell@canonical.com>2017-09-21 14:41:48 +1200
commit321b3ce87b9fc0e72b472bf96c4fc75fd9f35fc8 (patch)
tree300375a447ca0d3a8a84f3b820f08fbcd87a07a0
parent9da0e1b1cac28bb78d27d3c0447a48c1251de553 (diff)
downloadlightdm-git-321b3ce87b9fc0e72b472bf96c4fc75fd9f35fc8.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