Blame SOURCES/0001-authPrompt-allow-empty-response-to-PAM-messages.patch

f3cbb9
From 497fa4820897bf6579cfc11b33b383a36faca408 Mon Sep 17 00:00:00 2001
f3cbb9
From: Ray Strode <rstrode@redhat.com>
f3cbb9
Date: Wed, 14 Jun 2017 10:05:36 -0400
f3cbb9
Subject: [PATCH] authPrompt: allow empty response to PAM messages
f3cbb9
f3cbb9
Some PAM modules say "Press enter to continue" or
f3cbb9
whatever.  We need to support them.
f3cbb9
f3cbb9
This commit allows empty responses to PAM questions,
f3cbb9
but still requires a non-empty response for username.
f3cbb9
---
f3cbb9
 js/gdm/authPrompt.js | 4 ++--
f3cbb9
 1 file changed, 2 insertions(+), 2 deletions(-)
f3cbb9
f3cbb9
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
f3cbb9
index ae03a5b49..a18615059 100644
f3cbb9
--- a/js/gdm/authPrompt.js
f3cbb9
+++ b/js/gdm/authPrompt.js
f3cbb9
@@ -213,61 +213,61 @@ const AuthPrompt = new Lang.Class({
f3cbb9
         this._buttonBox.add(this._defaultButtonWell,
f3cbb9
                             { expand: true,
f3cbb9
                               x_fill: false,
f3cbb9
                               y_fill: false,
f3cbb9
                               x_align: St.Align.END,
f3cbb9
                               y_align: St.Align.MIDDLE });
f3cbb9
         this.nextButton = new St.Button({ style_class: 'modal-dialog-button button',
f3cbb9
                                           button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
f3cbb9
                                           reactive: true,
f3cbb9
                                           can_focus: true,
f3cbb9
                                           label: _("Next") });
f3cbb9
         this.nextButton.connect('clicked',
f3cbb9
                                  Lang.bind(this, function() {
f3cbb9
                                      this.emit('next');
f3cbb9
                                  }));
f3cbb9
         this.nextButton.add_style_pseudo_class('default');
f3cbb9
         this._buttonBox.add(this.nextButton,
f3cbb9
                             { expand: false,
f3cbb9
                               x_fill: false,
f3cbb9
                               y_fill: false,
f3cbb9
                               x_align: St.Align.END,
f3cbb9
                               y_align: St.Align.END });
f3cbb9
 
f3cbb9
         this._updateNextButtonSensitivity(this._entry.text.length > 0);
f3cbb9
 
f3cbb9
         this._entry.clutter_text.connect('text-changed',
f3cbb9
                                          Lang.bind(this, function() {
f3cbb9
                                              if (!this._userVerifier.hasPendingMessages && this._queryingService && !this._preemptiveAnswer)
f3cbb9
                                                  this._fadeOutMessage();
f3cbb9
 
f3cbb9
-                                             this._updateNextButtonSensitivity(this._entry.text.length > 0);
f3cbb9
+                                             this._updateNextButtonSensitivity(this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING);
f3cbb9
                                          }));
f3cbb9
         this._entry.clutter_text.connect('activate', Lang.bind(this, function() {
f3cbb9
             if (this.nextButton.reactive)
f3cbb9
                 this.emit('next');
f3cbb9
         }));
f3cbb9
     },
f3cbb9
 
f3cbb9
     _onAskQuestion: function(verifier, serviceName, question, passwordChar) {
f3cbb9
         if (this._queryingService)
f3cbb9
             this.clear();
f3cbb9
 
f3cbb9
         this._queryingService = serviceName;
f3cbb9
         if (this._preemptiveAnswer) {
f3cbb9
             this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
f3cbb9
             this._preemptiveAnswer = null;
f3cbb9
             return;
f3cbb9
         }
f3cbb9
         this.setPasswordChar(passwordChar);
f3cbb9
         this.setQuestion(question);
f3cbb9
 
f3cbb9
         if (passwordChar) {
f3cbb9
             if (this._userVerifier.reauthenticating)
f3cbb9
                 this.nextButton.label = _("Unlock");
f3cbb9
             else
f3cbb9
                 this.nextButton.label = C_("button", "Sign In");
f3cbb9
         } else {
f3cbb9
             this.nextButton.label = _("Next");
f3cbb9
         }
f3cbb9
 
f3cbb9
         this.updateSensitivity(true);
f3cbb9
@@ -446,61 +446,61 @@ const AuthPrompt = new Lang.Class({
f3cbb9
                            transition: 'easeOutQuad'
f3cbb9
                          });
f3cbb9
     },
f3cbb9
 
f3cbb9
     setMessage: function(message, type) {
f3cbb9
         if (type == GdmUtil.MessageType.ERROR)
f3cbb9
             this._message.add_style_class_name('login-dialog-message-warning');
f3cbb9
         else
f3cbb9
             this._message.remove_style_class_name('login-dialog-message-warning');
f3cbb9
 
f3cbb9
         if (type == GdmUtil.MessageType.HINT)
f3cbb9
             this._message.add_style_class_name('login-dialog-message-hint');
f3cbb9
         else
f3cbb9
             this._message.remove_style_class_name('login-dialog-message-hint');
f3cbb9
 
f3cbb9
         if (message) {
f3cbb9
             Tweener.removeTweens(this._message);
f3cbb9
             this._message.text = message;
f3cbb9
             this._message.opacity = 255;
f3cbb9
         } else {
f3cbb9
             this._message.opacity = 0;
f3cbb9
         }
f3cbb9
     },
f3cbb9
 
f3cbb9
     _updateNextButtonSensitivity: function(sensitive) {
f3cbb9
         this.nextButton.reactive = sensitive;
f3cbb9
         this.nextButton.can_focus = sensitive;
f3cbb9
     },
f3cbb9
 
f3cbb9
     updateSensitivity: function(sensitive) {
f3cbb9
-        this._updateNextButtonSensitivity(sensitive && this._entry.text.length > 0);
f3cbb9
+        this._updateNextButtonSensitivity(sensitive && (this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING));
f3cbb9
         this._entry.reactive = sensitive;
f3cbb9
         this._entry.clutter_text.editable = sensitive;
f3cbb9
     },
f3cbb9
 
f3cbb9
     hide: function() {
f3cbb9
         this.setActorInDefaultButtonWell(null, true);
f3cbb9
         this.actor.hide();
f3cbb9
         this._message.opacity = 0;
f3cbb9
 
f3cbb9
         this.setUser(null);
f3cbb9
 
f3cbb9
         this.updateSensitivity(true);
f3cbb9
         this._entry.set_text('');
f3cbb9
     },
f3cbb9
 
f3cbb9
     setUser: function(user) {
f3cbb9
         let oldChild = this._userWell.get_child();
f3cbb9
         if (oldChild)
f3cbb9
             oldChild.destroy();
f3cbb9
 
f3cbb9
         if (user) {
f3cbb9
             let userWidget = new UserWidget.UserWidget(user);
f3cbb9
             this._userWell.set_child(userWidget.actor);
f3cbb9
         }
f3cbb9
     },
f3cbb9
 
f3cbb9
     _onUserStoppedTypePreemptiveAnswer: function() {
f3cbb9
         if (!this._preemptiveAnswerWatchId ||
f3cbb9
             this._preemptiveAnswer ||
f3cbb9
             this._queryingService)
f3cbb9
-- 
f3cbb9
2.13.0
f3cbb9