From 829a096ba1c14eec04ebe69740fc49971ac2432b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 2 Feb 2021 17:57:45 +0100 Subject: [PATCH] gdm: Restart only the service that failed at verification-failure When verification failed using a specific authentication service we're currently restarting the whole user authentication system, which leads to lots of unneeded operations (reinitializing a new user verifier proxy, restarting all the gdm workers with the relative PAM modules and so on). And this makes also debugging of login problems more complicated, given we're cluttering the journal with repeated data. However, at reauthentication failure GDM has already set up for us an user verifier that we can use reuse to start only the service that had a failure. So when possible, just start a new service instead of rebooting the whole authorization process. Part-of: --- js/gdm/util.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/gdm/util.js b/js/gdm/util.js index 15f8de0fe..a98d63509 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -591,9 +591,10 @@ var ShellUserVerifier = class { this._onReset(); } - _retry() { - this.cancel(); - this.begin(this._userName, new Batch.Hold()); + _retry(serviceName) { + this._hold = new Batch.Hold(); + this._connectSignals(); + this._startService(serviceName); } _verificationFailed(serviceName, retry) { @@ -611,13 +612,13 @@ var ShellUserVerifier = class { if (canRetry) { if (!this.hasPendingMessages) { - this._retry(); + this._retry(serviceName); } else { const cancellable = this._cancellable; let signalId = this.connect('no-more-messages', () => { this.disconnect(signalId); if (!cancellable.is_cancelled()) - this._retry(); + this._retry(serviceName); }); } } else {