gnome-shell/1821.patch
2021-04-28 19:02:37 +02:00

222 lines
7.2 KiB
Diff

From e7998b4d5547d65d88c56d428a65c9fb3bbeadb0 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 28 Apr 2021 10:36:46 -0400
Subject: [PATCH 1/5] authPrompt: Don't clear querying service unless querying
service fails
At the moment we treat a failure in any service as a signal to stop
tracking users responses to service questions.
This commit makes sure we don't stop waiting for answers if a background
service fails.
---
js/gdm/authPrompt.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index d2c9a16594..c182d74318 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -280,8 +280,11 @@ var AuthPrompt = GObject.registerClass({
_onVerificationFailed(userVerifier, serviceName, canRetry) {
const wasQueryingService = this._queryingService === serviceName;
- this._queryingService = null;
- this.clear();
+
+ if (wasQueryingService) {
+ this._queryingService = null;
+ this.clear();
+ }
this.updateSensitivity(canRetry);
this.setActorInDefaultButtonWell(null);
--
GitLab
From ca290737ab3ecb028f03c9189dac6131e2dcf3bc Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 28 Apr 2021 10:38:58 -0400
Subject: [PATCH 2/5] authPrompt: Don't fail auth prompt until user is out of
retries
At the moment we set the state of the auth prompt to failed any
time the user fails an attempt. But verification is still going
on until the user exhausts all attempts, so that's wrong.
This commit changes it to only set the state to failed when the
user is out of tries.
---
js/gdm/authPrompt.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index c182d74318..d111cadd1b 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -288,7 +288,9 @@ var AuthPrompt = GObject.registerClass({
this.updateSensitivity(canRetry);
this.setActorInDefaultButtonWell(null);
- this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED;
+
+ if (!canRetry)
+ this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED;
if (wasQueryingService)
Util.wiggle(this._entry);
--
GitLab
From 36ccf63b7a219b7e0eb11158f39c8823a25eb058 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 28 Apr 2021 10:42:14 -0400
Subject: [PATCH 3/5] gdm: Flip canRetry boolean to doneTrying on verification
failure
This commit just flips a boolean in the verification failed handler
to make things easier to read.
---
js/gdm/util.js | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 1ee84acde2..bb120a81c2 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -685,29 +685,19 @@ var ShellUserVerifier = class {
(this._reauthOnly || this._failCounter < this.allowedFailures);
}
- _verificationFailed(serviceName, retry) {
+ _verificationFailed(serviceName, shouldRetry) {
// For Not Listed / enterprise logins, immediately reset
// the dialog
// Otherwise, when in login mode we allow ALLOWED_FAILURES attempts.
// After that, we go back to the welcome screen.
- const canRetry = retry && this._canRetry();
-
this._disconnectSignals();
+
this._filterServiceMessages(serviceName, MessageType.ERROR);
- if (canRetry) {
- if (!this.hasPendingMessages) {
- this._retry(serviceName);
- } else {
- const cancellable = this._cancellable;
- let signalId = this.connect('no-more-messages', () => {
- this.disconnect(signalId);
- if (!cancellable.is_cancelled())
- this._retry(serviceName);
- });
- }
- } else {
+ const doneTrying = !shouldRetry || !this._canRetry();
+
+ if (doneTrying) {
// eslint-disable-next-line no-lonely-if
if (!this.hasPendingMessages) {
this._cancelAndReset();
@@ -721,7 +711,18 @@ var ShellUserVerifier = class {
}
}
- this.emit('verification-failed', serviceName, canRetry);
+ this.emit('verification-failed', serviceName, !doneTrying);
+
+ if (!this.hasPendingMessages) {
+ this._retry(serviceName);
+ } else {
+ const cancellable = this._cancellable;
+ let signalId = this.connect('no-more-messages', () => {
+ this.disconnect(signalId);
+ if (!cancellable.is_cancelled())
+ this._retry(serviceName);
+ });
+ }
}
_onServiceUnavailable(_client, serviceName, errorMessage) {
--
GitLab
From de06a365e968691a4c2b39de8d5903a92f3663ec Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 28 Apr 2021 10:44:56 -0400
Subject: [PATCH 4/5] gdm: Only disconect verification signals when not going
to retry
At the moment a failure in a background service can lead to the
various verification signals getting disconnected, even though
we still need them for a foreground service.
This commit changes the code to only disconnect when we've run
out of tries.
---
js/gdm/util.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index bb120a81c2..bdc14b7519 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -691,13 +691,13 @@ var ShellUserVerifier = class {
// Otherwise, when in login mode we allow ALLOWED_FAILURES attempts.
// After that, we go back to the welcome screen.
- this._disconnectSignals();
-
this._filterServiceMessages(serviceName, MessageType.ERROR);
const doneTrying = !shouldRetry || !this._canRetry();
if (doneTrying) {
+ this._disconnectSignals();
+
// eslint-disable-next-line no-lonely-if
if (!this.hasPendingMessages) {
this._cancelAndReset();
--
GitLab
From 70f1e4a0d41956a5e91c31bea4d0060c9eb0bf45 Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Wed, 28 Apr 2021 18:32:22 +0200
Subject: [PATCH 5/5] gdm: Remove pending fingerprint verification failure
It can happen that we get a problem report and a verification failure at
the same time. For fingerprint, a problem report can result in an
internal verification failure to be queued.
Remove this queued failure again if we got a failure already from GDM
directly.
---
js/gdm/util.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/js/gdm/util.js b/js/gdm/util.js
index bdc14b7519..b02cd4d734 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -686,6 +686,11 @@ var ShellUserVerifier = class {
}
_verificationFailed(serviceName, shouldRetry) {
+ if (serviceName === FINGERPRINT_SERVICE_NAME) {
+ if (this._fingerprintFailedId)
+ GLib.source_remove(this._fingerprintFailedId);
+ }
+
// For Not Listed / enterprise logins, immediately reset
// the dialog
// Otherwise, when in login mode we allow ALLOWED_FAILURES attempts.
--
GitLab