swaylock icon indicating copy to clipboard operation
swaylock copied to clipboard

Add support for displaying failed attempt timeout

Open o-alquimista opened this issue 5 years ago • 5 comments

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

o-alquimista avatar Oct 19 '20 15:10 o-alquimista

For context, this is faillock's doing.

alecmev avatar Nov 23 '20 10:11 alecmev

I don't think there's a PAM API to know what the remaining time is.

emersion avatar Jun 08 '21 11:06 emersion

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.

kennylevinsen avatar Jun 08 '21 11:06 kennylevinsen

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.

subnut avatar Aug 02 '21 04:08 subnut

Got hit by this yesterday.

Please use reactions for +1'ing.

kennylevinsen avatar Aug 02 '21 07:08 kennylevinsen