aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-07-20 16:07:23 +0000
committerTiago Cunha <tcunha@gmx.com>2009-07-20 16:07:23 +0000
commit54c6848d75bb4ab33cfeb0dd60e258ea799ffe55 (patch)
tree54ca1169651f1b796e0a92cbd8a0bbcc53e6b33a /server.c
parent9a07e8f3724646762708eab10e102a6a9a8c5583 (diff)
downloadrtmux-54c6848d75bb4ab33cfeb0dd60e258ea799ffe55.tar.gz
rtmux-54c6848d75bb4ab33cfeb0dd60e258ea799ffe55.tar.bz2
rtmux-54c6848d75bb4ab33cfeb0dd60e258ea799ffe55.zip
Sync OpenBSD patchset 148:
Display the number of failed password attempts (if any) when the server is locked. From Tom Doherty.
Diffstat (limited to 'server.c')
-rw-r--r--server.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/server.c b/server.c
index 7d9a1568..2c2d0ab3 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.160 2009-07-20 15:42:05 tcunha Exp $ */
+/* $Id: server.c,v 1.161 2009-07-20 16:07:23 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -584,6 +584,7 @@ server_redraw_locked(struct client *c)
{
struct screen_write_ctx ctx;
struct screen screen;
+ struct grid_cell gc;
u_int colour, xx, yy, i;
int style;
@@ -594,10 +595,21 @@ server_redraw_locked(struct client *c)
colour = options_get_number(&global_w_options, "clock-mode-colour");
style = options_get_number(&global_w_options, "clock-mode-style");
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ gc.fg = colour;
+ gc.attr |= GRID_ATTR_BRIGHT;
+
screen_init(&screen, xx, yy, 0);
screen_write_start(&ctx, NULL, &screen);
clock_draw(&ctx, colour, style);
+
+ if (password_failures != 0) {
+ screen_write_cursormove(&ctx, 0, 0);
+ screen_write_puts(
+ &ctx, &gc, "%u failed attempts", password_failures);
+ }
+
screen_write_stop(&ctx);
for (i = 0; i < screen_size_y(&screen); i++)