Closed layus closed 6 years ago
Hi,
Typing too fast has a strange undefined behavior in the AUTH_WRONG state. This happens often to me as I type my password fairly quickly but, for some reason, I tend to make many mistakes.
When in AUTH_WRONG state, hitting enter (or any validation key) sets retry_verification = true; https://github.com/i3/i3lock/blob/ad680b40192f665dd7af4d62ab6996318e275cb6/i3lock.c#L435 If more characters are typed after that, they are added after the validated password, making it useless when verification is retried.
retry_verification = true;
For example, with a password set to abcd. Typing "xxxx\nabcd\nab" within two seconds will
"xxxx\nabcd\nab"
retry_verification
true
This can go on for some time, as the logical continuation is to type "cd\n", which will obviously spoil the next attempt, and so on.
I would suggest to either
Hi,
Typing too fast has a strange undefined behavior in the AUTH_WRONG state. This happens often to me as I type my password fairly quickly but, for some reason, I tend to make many mistakes.
When in AUTH_WRONG state, hitting enter (or any validation key) sets
retry_verification = true;
https://github.com/i3/i3lock/blob/ad680b40192f665dd7af4d62ab6996318e275cb6/i3lock.c#L435 If more characters are typed after that, they are added after the validated password, making it useless when verification is retried.For example, with a password set to abcd. Typing
"xxxx\nabcd\nab"
within two seconds willretry_verification
totrue
.This can go on for some time, as the logical continuation is to type "cd\n", which will obviously spoil the next attempt, and so on.
I would suggest to either
retry_verification
and keep extra characters in a separate buffer.