Merge lp:~robert-ancell/lightdm/handle-greeter-fail-after-autologin into lp:lightdm

Proposed by Robert Ancell
Status: Merged
Approved by: Robert Ancell
Approved revision: 1834
Merged at revision: 1834
Proposed branch: lp:~robert-ancell/lightdm/handle-greeter-fail-after-autologin
Merge into: lp:lightdm
Diff against target: 136 lines (+58/-2)
6 files modified
src/seat.c (+13/-2)
tests/Makefile.am (+4/-0)
tests/scripts/autologin-invalid-greeter.conf (+30/-0)
tests/scripts/login-invalid-greeter.conf (+7/-0)
tests/test-autologin-invalid-greeter (+2/-0)
tests/test-login-invalid-greeter (+2/-0)
To merge this branch: bzr merge lp:~robert-ancell/lightdm/handle-greeter-fail-after-autologin
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Robert Ancell Approve
Review via email: mp+193362@code.launchpad.net

Commit message

Fix crash if switching to greeter and it isn't installed

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/seat.c'
2--- src/seat.c 2013-10-30 20:19:23 +0000
3+++ src/seat.c 2013-10-31 00:39:59 +0000
4@@ -392,7 +392,11 @@
5 if (!active_session || session_get_display_server (active_session) == display_server)
6 {
7 l_debug (seat, "Active display server stopped, starting greeter");
8- seat_switch_to_greeter (seat);
9+ if (!seat_switch_to_greeter (seat))
10+ {
11+ l_debug (seat, "Stopping; failed to start a greeter");
12+ seat_stop (seat);
13+ }
14 }
15 }
16
17@@ -671,7 +675,11 @@
18 else if (!IS_GREETER (session) && session == seat_get_active_session (seat))
19 {
20 l_debug (seat, "Active session stopped, starting greeter");
21- seat_switch_to_greeter (seat);
22+ if (!seat_switch_to_greeter (seat))
23+ {
24+ l_debug (seat, "Stopping; failed to start a greeter");
25+ seat_stop (seat);
26+ }
27 }
28
29 /* Stop the display server if no-longer required */
30@@ -1241,6 +1249,9 @@
31 }
32
33 greeter_session = create_greeter_session (seat);
34+ if (!greeter_session)
35+ return FALSE;
36+
37 if (seat->priv->session_to_activate)
38 g_object_unref (seat->priv->session_to_activate);
39 seat->priv->session_to_activate = g_object_ref (greeter_session);
40
41=== modified file 'tests/Makefile.am'
42--- tests/Makefile.am 2013-10-30 22:28:22 +0000
43+++ tests/Makefile.am 2013-10-31 00:39:59 +0000
44@@ -22,6 +22,7 @@
45 test-autologin-guest-in-background \
46 test-autologin-timeout-in-background \
47 test-autologin-invalid-user \
48+ test-autologin-invalid-greeter \
49 test-autologin-invalid-session \
50 test-crash-authenticate \
51 test-autologin-xserver-crash \
52@@ -72,6 +73,7 @@
53 test-language \
54 test-language-no-accounts-service \
55 test-login-crash-authenticate \
56+ test-login-invalid-greeter \
57 test-login-gobject \
58 test-login-gobject-manual \
59 test-login-gobject-manual-previous-session \
60@@ -307,6 +309,7 @@
61 scripts/autologin-guest-logout.conf \
62 scripts/autologin-guest-timeout.conf \
63 scripts/autologin-in-background.conf \
64+ scripts/autologin-invalid-greeter.conf \
65 scripts/autologin-guest-in-background.conf \
66 scripts/autologin-timeout-in-background.conf \
67 scripts/autologin-invalid-session.conf \
68@@ -362,6 +365,7 @@
69 scripts/login-guest-logout.conf \
70 scripts/login-guest-no-setup-script.conf \
71 scripts/login-info-prompt.conf \
72+ scripts/login-invalid-greeter.conf \
73 scripts/login-invalid-session.conf \
74 scripts/login-invalid-user.conf \
75 scripts/login-logout.conf \
76
77=== added file 'tests/scripts/autologin-invalid-greeter.conf'
78--- tests/scripts/autologin-invalid-greeter.conf 1970-01-01 00:00:00 +0000
79+++ tests/scripts/autologin-invalid-greeter.conf 2013-10-31 00:39:59 +0000
80@@ -0,0 +1,30 @@
81+#
82+# Check quits if autologin session ends and no valid greeter
83+#
84+
85+[SeatDefaults]
86+autologin-user=have-password1
87+user-session=default
88+
89+#?RUNNER DAEMON-START
90+
91+# X server starts
92+#?XSERVER-0 START VT=7
93+
94+# Daemon connects when X server is ready
95+#?*XSERVER-0 INDICATE-READY
96+#?XSERVER-0 INDICATE-READY
97+#?XSERVER-0 ACCEPT-CONNECT
98+
99+# Session starts
100+#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 DESKTOP_SESSION=default USER=have-password1
101+#?XSERVER-0 ACCEPT-CONNECT
102+#?SESSION-X-0 CONNECT-XSERVER
103+
104+# Logout session
105+#?*SESSION-X-0 LOGOUT
106+
107+# X server stops
108+#?XSERVER-0 TERMINATE SIGNAL=15
109+
110+#?RUNNER DAEMON-EXIT STATUS=1
111
112=== added file 'tests/scripts/login-invalid-greeter.conf'
113--- tests/scripts/login-invalid-greeter.conf 1970-01-01 00:00:00 +0000
114+++ tests/scripts/login-invalid-greeter.conf 2013-10-31 00:39:59 +0000
115@@ -0,0 +1,7 @@
116+#
117+# Check fails to start if invalid greeter
118+#
119+
120+#?RUNNER DAEMON-START
121+
122+#?RUNNER DAEMON-EXIT STATUS=1
123
124=== added file 'tests/test-autologin-invalid-greeter'
125--- tests/test-autologin-invalid-greeter 1970-01-01 00:00:00 +0000
126+++ tests/test-autologin-invalid-greeter 2013-10-31 00:39:59 +0000
127@@ -0,0 +1,2 @@
128+#!/bin/sh
129+./src/dbus-env ./src/test-runner autologin-invalid-greeter INVALID
130
131=== added file 'tests/test-login-invalid-greeter'
132--- tests/test-login-invalid-greeter 1970-01-01 00:00:00 +0000
133+++ tests/test-login-invalid-greeter 2013-10-31 00:39:59 +0000
134@@ -0,0 +1,2 @@
135+#!/bin/sh
136+./src/dbus-env ./src/test-runner login-invalid-greeter INVALID

Subscribers

People subscribed via source and target branches