[gnome-shell] authPrompt: fix disable-user-list / Not Listed?



commit a70e74e478b4413b53b65490e72370d0e26de2d7
Author: Ray Strode <rstrode redhat com>
Date:   Fri Aug 2 14:10:16 2013 -0400

    authPrompt: fix disable-user-list / Not Listed?
    
    If the first question asked to a user is from the
    shell and not from the PAM service (i.e. Username: ),
    then we'll save what the user types until PAM asks
    a question and then try to send it to PAM.
    
    This commit makes sure the preemptive answer can be used
    before the PAM conversation gets started, and makes sure
    to discard the preemptive answer if we're not expecting it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705370

 js/gdm/authPrompt.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 7bda7b5..07a92b7 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -190,7 +190,8 @@ const AuthPrompt = new Lang.Class({
 
     _onAskQuestion: function(verifier, serviceName, question, passwordChar) {
         if (this._preemptiveAnswer) {
-            this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
+            if (this._queryingService)
+                this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
             this._preemptiveAnswer = null;
             return;
         }
@@ -341,7 +342,14 @@ const AuthPrompt = new Lang.Class({
     },
 
     getAnswer: function() {
-        let text = this._entry.get_text();
+        let text;
+
+        if (this._preemptiveAnswer) {
+            text = this._preemptiveAnswer;
+            this._preemptiveAnswer = null;
+        } else {
+            text = this._entry.get_text();
+        }
 
         return text;
     },


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