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



commit 36fba1a184dc6a142de2acd401224c9f323f8acc
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/1622>

 js/gdm/util.js | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 587a2c9415..0465609195 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -501,6 +501,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(this._userName
                 ? 'Failed to start verification for user'
                 : 'Failed to start verification', e);


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