aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2016-09-15 09:11:49 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-09-15 09:12:18 +0000
commit440a813afff0260ed0030c9debf1c15a60121a7f (patch)
tree3e3b27618139384677ab2cf02cbb451c6e8fe75a
parentdf985b3fea30d85e86c7e123d7fb3fd65a09703c (diff)
downloadarctica-greeter-440a813afff0260ed0030c9debf1c15a60121a7f.tar.gz
arctica-greeter-440a813afff0260ed0030c9debf1c15a60121a7f.tar.bz2
arctica-greeter-440a813afff0260ed0030c9debf1c15a60121a7f.zip
Limit prompt fields to 200 characters in case a key is being held down (e.g. by a cat).
-rw-r--r--src/greeter-list.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/greeter-list.vala b/src/greeter-list.vala
index 7fafdcb..5f830da 100644
--- a/src/greeter-list.vala
+++ b/src/greeter-list.vala
@@ -19,6 +19,8 @@
* Scott Sweeny <scott.sweeny@canonical.com>
*/
+private const int MAX_FIELD_SIZE = 200;
+
private int get_grid_offset (int size)
{
return (int) (size % grid_size) / 2;
@@ -808,7 +810,10 @@ public abstract class GreeterList : FadableBox
text = _("Password:");
if (text == "login:")
text = _("Username:");
- add_prompt (text, type == LightDM.PromptType.SECRET);
+ var entry = add_prompt (text, type == LightDM.PromptType.SECRET);
+
+ /* Limit the number of characters in case a cat is sitting on the keyboard... */
+ entry.max_length = MAX_FIELD_SIZE;
}
protected virtual void authentication_complete_cb ()