summaryrefslogtreecommitdiffstats
path: root/x11vnc/unixpw.c
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/unixpw.c')
-rw-r--r--x11vnc/unixpw.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/x11vnc/unixpw.c b/x11vnc/unixpw.c
index c4a08b9..9390b43 100644
--- a/x11vnc/unixpw.c
+++ b/x11vnc/unixpw.c
@@ -1126,6 +1126,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
int x, y, i, rc, nmax = 100;
static char user_r[100], user[100], pass[100];
static int u_cnt = 0, p_cnt = 0, first = 1;
+ static int echo = 1;
char keystr[100];
char *str;
@@ -1143,6 +1144,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
in_login = 1;
in_passwd = 0;
unixpw_denied = 0;
+ echo = 1;
if (init == 1) {
tries = 0;
}
@@ -1209,6 +1211,11 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
} else if (! down) {
return;
}
+ if (in_login && keysym == XK_Escape && u_cnt == 0) {
+ echo = 0;
+ rfbLog("unixpw_keystroke: echo off.\n");
+ return;
+ }
if (in_login) {
if (keysym == XK_BackSpace || keysym == XK_Delete) {
@@ -1295,8 +1302,10 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
x = text_x();
y = text_y();
- rfbDrawString(pscreen, &default8x16Font, x, y,
- str, white_pixel());
+ if (echo) {
+ rfbDrawString(pscreen, &default8x16Font, x, y,
+ str, white_pixel());
+ }
mark_rect_as_modified(x, y-char_h, x+char_w,
y, scaling);
char_col++;
@@ -1340,7 +1349,9 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
if (db && db <= 2) fprintf(stderr, "u_cnt: %d %d/%d ks: 0x%x '%s'\n", u_cnt, x, y, keysym, keystr);
- rfbDrawString(pscreen, &default8x16Font, x, y, keystr, white_pixel());
+ if (echo ) {
+ rfbDrawString(pscreen, &default8x16Font, x, y, keystr, white_pixel());
+ }
mark_rect_as_modified(x, y-char_h, x+char_w, y, scaling);
char_col++;