Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release-src > by-pkgid > e4eefdcb6b6356cc62de6c8445940f95 > files > 6

gnome-shell-3.14.3-7.mga5.src.rpm

From 256b8e0a509917e54b4e9b270c0abafd1c953e3a Mon Sep 17 00:00:00 2001
From: Shivam Mishra <shivam.m@live.com>
Date: Wed, 8 Apr 2015 01:23:42 +0530
Subject: authPrompt: Fix hang if user types password really fast

It's possible for a user to type their password so quickly
that GDM hasn't even had time to ask for the password yet,
much less have time to process the answer.
In that situation, we tuck the user response away as
_preemptiveAnswer, and pass it along to GDM when GDM is finally
ready for it.
The problem is, there's a bug in the code, where we send
null for the service name in the answer, instead of the right
service name (say "gdm-password").
This commit addresses the bug by making sure we don't pass the
answer along, until the service name is properly set in
_queryingService. To ensure that, answering query (answerQuery)
based on _preemptiveAnswer has been shifted right below
this._queryingService = serviceName;

https://bugzilla.gnome.org/show_bug.cgi?id=737586

diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index a4d69d9..5c8c175 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -193,17 +193,15 @@ const AuthPrompt = new Lang.Class({
     },
 
     _onAskQuestion: function(verifier, serviceName, question, passwordChar) {
-        if (this._preemptiveAnswer) {
-            if (this._queryingService)
-                this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
-            this._preemptiveAnswer = null;
-            return;
-        }
-
         if (this._queryingService)
             this.clear();
 
         this._queryingService = serviceName;
+        if (this._preemptiveAnswer) {
+            this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
+            this._preemptiveAnswer = null;
+            return;
+        }
         this.setPasswordChar(passwordChar);
         this.setQuestion(question);
 
-- 
cgit v0.10.2