[gnome-shell/gnome-3-36] gdm: Do not fail the whole authentication if a background service failed



commit 7143d321a0c8f09aa8b1aa7a633b43a0b4f0a21b
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Feb 2 16:30:11 2021 +0100

    gdm: Do not fail the whole authentication if a background service failed
    
    In case a background service such as the fingerprint authentication
    fails to start we'd just mark the whole authentication process as
    failed.
    
    Currently this may happen by just putting a wrong password when an user
    has some fingerprints enrolled, the fingerprint gdm authentication
    worker may take some time to restart leading to a failure and this is
    currently also making the password authentication to fail:
    
        JS ERROR: Failed to start gdm-fingerprint for u: Gio.DBusError:
            GDBus.Error:org.freedesktop.DBus.Error.Spawn.Failed:
                Could not create authentication helper process
            _promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:435:45
            ### Promise created here: ###
            _startService@resource:///org/gnome/shell/gdm/util.js:470:42
            _beginVerification@resource:///org/gnome/shell/gdm/util.js:495:18
            _getUserVerifier@resource:///org/gnome/shell/gdm/util.js:405:14
            async*_openReauthenticationChannel@resource:///org/gnome/shell/gdm/util.js:378:22
            async*begin@resource:///org/gnome/shell/gdm/util.js:194:18
            _retry@resource:///org/gnome/shell/gdm/util.js:561:14
            _verificationFailed/signalId<@resource:///org/gnome/shell/gdm/util.js:584:30
            _emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
            finishMessageQueue@resource:///org/gnome/shell/gdm/util.js:268:14
            _queueMessageTimeout@resource:///org/gnome/shell/gdm/util.js:273:18
            _queueMessageTimeout/this._messageQueueTimeoutId<@resource:///org/gnome/shell/gdm/util.js:288:65
    
    Given that background services are ignored even for queries or any kind
    of message, we should not fail the authentication request unless the
    default service fails.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1784>

 js/gdm/util.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index ce2e7abfd4..3ffa18d0ec 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -432,6 +432,11 @@ var ShellUserVerifier = class {
                 } catch (e) {
                     if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                         return;
+                    if (!this.serviceIsForeground(serviceName)) {
+                        logError(e, 'Failed to start %s for %s'.format(serviceName, this._userName));
+                        this._hold.release();
+                        return;
+                    }
                     this._reportInitError('Failed to start verification for user', e);
                     return;
                 }
@@ -445,6 +450,11 @@ var ShellUserVerifier = class {
                 } catch (e) {
                     if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
                         return;
+                    if (!this.serviceIsForeground(serviceName)) {
+                        logError(e, 'Failed to start %s'.format(serviceName));
+                        this._hold.release();
+                        return;
+                    }
                     this._reportInitError('Failed to start verification', e);
                     return;
                 }


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