From 440a813afff0260ed0030c9debf1c15a60121a7f Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Thu, 15 Sep 2016 09:11:49 +0000 Subject: Limit prompt fields to 200 characters in case a key is being held down (e.g. by a cat). --- src/greeter-list.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/greeter-list.vala') 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 */ +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 () -- cgit v1.2.3