Merge lp:~lbssousa/lightdm-gtk-greeter/fix-timed-autologin into lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk

Proposed by Laércio de Sousa
Status: Merged
Merged at revision: 328
Proposed branch: lp:~lbssousa/lightdm-gtk-greeter/fix-timed-autologin
Merge into: lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk
Diff against target: 45 lines (+28/-1)
1 file modified
src/lightdm-gtk-greeter.c (+28/-1)
To merge this branch: bzr merge lp:~lbssousa/lightdm-gtk-greeter/fix-timed-autologin
Reviewer Review Type Date Requested Status
Sean Davis Approve
Review via email: mp+257425@code.launchpad.net

Description of the change

This patch fixes a timed autologin issue. Currently, when autologin timeout expires, and configured autologin user is already selected in user list, lightdm-gtk-greeter's authentication_complete_cb() doesn't start user session unless user clicks on login button.

I've just found that global boolean variable "prompted" must be set to TRUE in timed autologin authentication callback function, in order to get user session started properly.

To post a comment you must log in.
326. By Laércio de Sousa

Avoid authenticating same use twice on timed autologin.

327. By Laércio de Sousa

Fix "prompted = TRUE;" misplacing in timed_autologin_cb() body.

Revision history for this message
Laércio de Sousa (lbssousa) wrote :

I've introduced some additional checks in order to avoid authenticating the same user twice (when it's selected in user list, and when lightdm_greeter_authenticate_autologin() is called).

Revision history for this message
Andrew P. (kalgasnik) wrote :

Thanks for clearing things up. Just one note.
Autologin will trigger each time a user locks screen with light-locker.
Greeter needs to perform a check to avoid it - "lightdm_greeter_get_lock_hint()".

328. By Laércio de Sousa

Avoid triggering autologin if user locks screen with light-locker.

329. By Laércio de Sousa

Add missing argument in previous commit.

Revision history for this message
Laércio de Sousa (lbssousa) wrote :

Check added. Thank you for the appointment!

Revision history for this message
Sean Davis (bluesabre) wrote :

Thanks for investigating this. The patch here looks sane and this is a very welcome fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lightdm-gtk-greeter.c'
2--- src/lightdm-gtk-greeter.c 2015-03-27 05:29:45 +0000
3+++ src/lightdm-gtk-greeter.c 2015-05-11 18:48:10 +0000
4@@ -2281,6 +2281,33 @@
5 }
6
7 static void
8+timed_autologin_cb (LightDMGreeter *greeter)
9+{
10+ /* Don't trigger autologin if user locks screen with light-locker (thanks to Andrew P.). */
11+ if (!lightdm_greeter_get_lock_hint (greeter))
12+ {
13+ if (lightdm_greeter_get_is_authenticated (greeter))
14+ {
15+ /* Configured autologin user may be already selected in user list. */
16+ if (lightdm_greeter_get_authentication_user (greeter))
17+ /* Selected user matches configured autologin-user option. */
18+ start_session ();
19+ else if (lightdm_greeter_get_autologin_guest_hint (greeter))
20+ /* "Guest session" is selected and autologin-guest is enabled. */
21+ start_session ();
22+ else if (lightdm_greeter_get_autologin_user_hint (greeter))
23+ {
24+ /* "Guest session" is selected, but autologin-user is configured. */
25+ start_authentication (lightdm_greeter_get_autologin_user_hint (greeter));
26+ prompted = TRUE;
27+ }
28+ }
29+ else
30+ lightdm_greeter_authenticate_autologin (greeter);
31+ }
32+}
33+
34+static void
35 authentication_complete_cb (LightDMGreeter *greeter)
36 {
37 prompt_active = FALSE;
38@@ -2625,7 +2652,7 @@
39 g_signal_connect (greeter, "show-prompt", G_CALLBACK (show_prompt_cb), NULL);
40 g_signal_connect (greeter, "show-message", G_CALLBACK (show_message_cb), NULL);
41 g_signal_connect (greeter, "authentication-complete", G_CALLBACK (authentication_complete_cb), NULL);
42- g_signal_connect (greeter, "autologin-timer-expired", G_CALLBACK (lightdm_greeter_authenticate_autologin), NULL);
43+ g_signal_connect (greeter, "autologin-timer-expired", G_CALLBACK (timed_autologin_cb), NULL);
44 if (!lightdm_greeter_connect_sync (greeter, NULL))
45 return EXIT_FAILURE;
46

Subscribers

People subscribed via source and target branches