Tell the user when sleeping due to password backoff.

pull/1/head
Nicholas Marriott 2009-09-04 13:29:10 +00:00
parent 751a2fa915
commit be0d6faa15
1 changed files with 11 additions and 0 deletions

View File

@ -605,6 +605,8 @@ server_redraw_locked(struct client *c)
screen_write_cursormove(&ctx, 0, 0);
screen_write_puts(
&ctx, &gc, "%u failed attempts", password_failures);
if (time(NULL) < password_backoff)
screen_write_puts(&ctx, &gc, "; sleeping");
}
screen_write_stop(&ctx);
@ -1183,6 +1185,7 @@ void
server_second_timers(void)
{
struct window *w;
struct client *c;
struct window_pane *wp;
u_int i;
int xtimeout;
@ -1191,6 +1194,7 @@ server_second_timers(void)
time_t t;
t = time(NULL);
xtimeout = options_get_number(&global_s_options, "lock-after-time");
if (xtimeout > 0 && t > server_activity + xtimeout)
server_lock();
@ -1206,6 +1210,13 @@ server_second_timers(void)
}
}
if (t > password_backoff) {
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
if ((c = ARRAY_ITEM(&clients, i)) != NULL)
server_redraw_client(c);
}
}
/* Check for a minute having passed. */
gmtime_r(&t, &now);
gmtime_r(&last_t, &then);