summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2008-01-17 16:27:08 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2008-01-17 16:27:08 +0000
commit5e7c870419c200ca908d691652e8e6f60123030a (patch)
tree2e13cb297811df4eca90a2c5988765d17241fd70 /lib
parent4b1e420d539f63174687545d0a80d0f59009734f (diff)
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')
-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;
}