summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2008-01-17 16:27:07 +0000
committermillert <millert@openbsd.org>2008-01-17 16:27:07 +0000
commit9462f6a9c24e19e4c04c452e3ff62e46cb864d63 (patch)
treeb497e1ab2afa3d2d34c8bbacb843cd3d2f7f2c1c /lib/libc
parentAdd splnet around mii_tick() in sk_yukon_tick(). (diff)
downloadwireguard-openbsd-9462f6a9c24e19e4c04c452e3ff62e46cb864d63.tar.xz
wireguard-openbsd-9462f6a9c24e19e4c04c452e3ff62e46cb864d63.zip
Use TCSAFLUSH instead of TCSANOW when turning echo back on so that
there is no chance of output that was written but still pending to be displayed. This is what the original getpass(3) did.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/readpassphrase.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c
index d5e6ba71eb2..470dc94c7c5 100644
--- a/lib/libc/gen/readpassphrase.c
+++ b/lib/libc/gen/readpassphrase.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readpassphrase.c,v 1.20 2007/10/30 12:03:48 millert Exp $ */
+/* $OpenBSD: readpassphrase.c,v 1.21 2008/01/17 16:27:07 millert Exp $ */
/*
* Copyright (c) 2000-2002, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -129,7 +129,7 @@ restart:
/* Restore old terminal settings and signals. */
if (memcmp(&term, &oterm, sizeof(term)) != 0) {
- while (tcsetattr(input, TCSANOW|TCSASOFT, &oterm) == -1 &&
+ while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 &&
errno == EINTR)
continue;
}