[gnome-shell/wip/rstrode/rhel-7.9: 81/86] gdm: Don't start new PAM conversation when shield is down




commit 776a5d6ecd2d307da3f21d33989ca8c17818b417
Author: rpm-build <rpm-build>
Date:   Wed Oct 14 13:08:01 2020 -0400

    gdm: Don't start new PAM conversation when shield is down
    
    At the moment, the auth prompt cancel function just calls
    reset, which leads to new authentication conversations getting started.
    
    This commit makes cancel end the current conversations without starting
    new ones.

 js/gdm/authPrompt.js  | 15 ++++++++++-----
 js/gdm/loginDialog.js |  5 +++++
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 15d3273fa3..744e6488c3 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -578,17 +578,15 @@ var AuthPrompt = new Lang.Class({
         this.updateSensitivity(false);
     },
 
-    reset() {
-        let oldStatus = this.verificationStatus;
+    _endActiveRequest() {
         this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
         this.cancelButton.reactive = true;
         this.nextButton.label = _("Next");
 
         if (this._preemptiveAnswerWatchId) {
             this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
+            this._preemptiveAnswerWatchId = 0;
         }
-        this._preemptiveAnswerWatchId = this._idleMonitor.add_idle_watch (500,
-                                                                          
this._onUserStoppedTypePreemptiveAnswer.bind(this));
 
         if (this._userVerifier)
             this._userVerifier.cancel();
@@ -598,6 +596,13 @@ var AuthPrompt = new Lang.Class({
         this._message.opacity = 0;
         this.setUser(null);
         this.stopSpinning();
+    },
+
+    reset() {
+        let oldStatus = this.verificationStatus;
+        this._endActiveRequest();
+        this._preemptiveAnswerWatchId = this._idleMonitor.add_idle_watch (500,
+                                                                          
this._onUserStoppedTypePreemptiveAnswer.bind(this));
 
         if (oldStatus == AuthPromptStatus.VERIFICATION_FAILED)
             this.emit('failed');
@@ -661,7 +666,7 @@ var AuthPrompt = new Lang.Class({
         if (this.verificationStatus == AuthPromptStatus.VERIFICATION_SUCCEEDED) {
             return;
         }
-        this.reset();
+        this._endActiveRequest();
         this.emit('cancelled');
     }
 });
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 06122eaa61..37e335e166 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -455,6 +455,7 @@ var LoginDialog = new Lang.Class({
         this._authPrompt = new AuthPrompt.AuthPrompt(this._gdmClient, 
AuthPrompt.AuthPromptMode.UNLOCK_OR_LOG_IN);
         this._authPrompt.connect('prompted', this._onPrompted.bind(this));
         this._authPrompt.connect('reset', this._onReset.bind(this));
+        this._authPrompt.connect('cancelled', this._onCancelled.bind(this));
         this._authPrompt.hide();
         this.actor.add_child(this._authPrompt.actor);
 
@@ -856,6 +857,10 @@ var LoginDialog = new Lang.Class({
         }
     },
 
+    _onCancelled(authPrompt) {
+        this._authPrompt.reset();
+    },
+
     _onDefaultSessionChanged(client, sessionId) {
         this._sessionMenuButton.setActiveSession(sessionId);
     },


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