[gdm/gnome-3-38] session: Only emit verification-complete on reauth or after session is opened



commit b0feff5fd2e2ac0bcadbac3e2e6e6d0e7cd40bb2
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Jul 9 18:09:08 2021 +0200

    session: Only emit verification-complete on reauth or after session is opened
    
    We're currently emitting verification-complete signal as soon as we
    got a positive authentication callback from the worker, however at this
    point we've not opened the session yet, and if that fails we'll end up
    in a scenario where gdm assumed that we're logging in, and so its
    greeter is shut down and never restarted on its VT until we manually
    switch back and forth from it. Meanwhile the session opening failure is
    never exposed to the user.
    
    So, do not emit verification-completed on logins, until we've opened
    the session.
    However, re-order the session-opened callback events so that we keep
    notifying verification-complete before than session-opened.
    
    This basically reverts commit c4292870 (again).
    
    Fixes: https://gitlab.gnome.org/GNOME/gdm/-/issues/712
    
    
    (cherry picked from commit f65c681a469a2675d96012a77a563e50369b9e54)

 daemon/gdm-session.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index ca7d98f16..5ef67fe5a 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -319,18 +319,18 @@ on_establish_credentials_cb (GdmDBusWorker *proxy,
         service_name = g_strdup (conversation->service_name);
 
         if (worked) {
-                if (self->user_verifier_interface != NULL) {
-                        gdm_dbus_user_verifier_emit_verification_complete (self->user_verifier_interface,
-                                                                           service_name);
-                        g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
-                }
-
                 switch (self->verification_mode) {
                 case GDM_SESSION_VERIFICATION_MODE_LOGIN:
                 case GDM_SESSION_VERIFICATION_MODE_CHOOSER:
                         gdm_session_open_session (self, service_name);
                         break;
                 case GDM_SESSION_VERIFICATION_MODE_REAUTHENTICATE:
+                        if (self->user_verifier_interface != NULL) {
+                                gdm_dbus_user_verifier_emit_verification_complete 
(self->user_verifier_interface,
+                                                                                   service_name);
+                                g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
+                        }
+                        break;
                 default:
                         break;
                 }
@@ -863,17 +863,17 @@ on_opened (GdmDBusWorker *worker,
 
                 conversation->session_id = g_strdup (session_id);
 
-                if (self->greeter_interface != NULL) {
-                        gdm_dbus_greeter_emit_session_opened (self->greeter_interface,
-                                                              service_name);
-                }
-
                 if (self->user_verifier_interface != NULL) {
                         gdm_dbus_user_verifier_emit_verification_complete (self->user_verifier_interface,
                                                                            service_name);
                         g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
                 }
 
+                if (self->greeter_interface != NULL) {
+                        gdm_dbus_greeter_emit_session_opened (self->greeter_interface,
+                                                              service_name);
+                }
+
                 g_debug ("GdmSession: Emitting 'session-opened' signal");
                 g_signal_emit (self, signals[SESSION_OPENED], 0, service_name, session_id);
         } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]