mirror of
https://github.com/tmux/tmux.git
synced 2025-09-08 23:24:18 +00:00
When incorrect passwords are entered, behave similarly to login(1) and backoff
for a bit. Based on a diff from martynas@.
This commit is contained in:
@ -99,8 +99,15 @@ server_msg_dispatch(struct client *c)
|
||||
memcpy(&unlockdata, imsg.data, sizeof unlockdata);
|
||||
|
||||
unlockdata.pass[(sizeof unlockdata.pass) - 1] = '\0';
|
||||
if (server_unlock(unlockdata.pass) != 0)
|
||||
switch (server_unlock(unlockdata.pass)) {
|
||||
case -1:
|
||||
server_write_error(c, "bad password");
|
||||
break;
|
||||
case -2:
|
||||
server_write_error(c,
|
||||
"too many bad passwords, sleeping");
|
||||
break;
|
||||
}
|
||||
memset(&unlockdata, 0, sizeof unlockdata);
|
||||
server_write_client(c, MSG_EXIT, NULL, 0);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user