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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1622>
This commit is contained in:
Marco Trevisan (Treviño) 2021-02-02 17:57:45 +01:00 committed by Marge Bot
parent 85ad1157df
commit 829a096ba1

View File

@ -591,9 +591,10 @@ var ShellUserVerifier = class {
this._onReset(); this._onReset();
} }
_retry() { _retry(serviceName) {
this.cancel(); this._hold = new Batch.Hold();
this.begin(this._userName, new Batch.Hold()); this._connectSignals();
this._startService(serviceName);
} }
_verificationFailed(serviceName, retry) { _verificationFailed(serviceName, retry) {
@ -611,13 +612,13 @@ var ShellUserVerifier = class {
if (canRetry) { if (canRetry) {
if (!this.hasPendingMessages) { if (!this.hasPendingMessages) {
this._retry(); this._retry(serviceName);
} else { } else {
const cancellable = this._cancellable; const cancellable = this._cancellable;
let signalId = this.connect('no-more-messages', () => { let signalId = this.connect('no-more-messages', () => {
this.disconnect(signalId); this.disconnect(signalId);
if (!cancellable.is_cancelled()) if (!cancellable.is_cancelled())
this._retry(); this._retry(serviceName);
}); });
} }
} else { } else {