swaylock
swaylock copied to clipboard
Add support for displaying failed attempt timeout
If I type the wrong password 3 times, the system locks my account for a couple of minutes - it shows a message with the remaining time when attempting to login through the console on another tty; but swaylock doesn't inform us about the lockout or how much time remains before we can try again.
Arch Linux Sway 1.5 Swaylock 1.4
For context, this is faillock's doing.
I don't think there's a PAM API to know what the remaining time is.
pam_faillock can be configured to emit a PAM_TEXT_INFO conversation call with a string explaining that you are locked out. In some configurations it will emit yet another message immediately after with the time remaining as of now.
This is a single arbitrary string that we cannot control or parse, and it will only update whenever you fail a login attempt.
Handling of this requires support for displaying arbitrary string messages emitted as PAM_TEXT_INFO or PAM_ERROR_MSG somewhere.
Got hit by this yesterday.
Tried unlocking my swaylock using the correct password. Failed. Tried again, failed. Tried a third time, feeling nervous. Failed. Waited a few seconds, tried again, very carefully. Failed. Started feeling very anxious, tried remembering my password carefully. Waited for a minute, and tried again. Still failed.
Pondering about what to do now, I switched to a tty to see if I could login there and kill swaylock. I entered my username into the login prompt, pressed Enter, and it showed a message -
This account is locked due to 3 failed logins (7 minutes left to unlock)
Turns out one of my friends had bashed the Enter key a lot.
Got hit by this yesterday.
Please use reactions for +1'ing.