diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-04-05 23:34:26 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-04-05 23:34:26 +0000 |
commit | cb64288cfed3d370f144dcfd2bc76094268019d9 (patch) | |
tree | 76fa78618e2271d8c5e540f41e9dfb442653262d /libc/unistd | |
parent | d179a27457c959dbe93b44c3803609138610472d (diff) |
Patch from Axel Barnitzke <barney@xkontor.com> to fixup
a problem with getpass() echoing passwords...
Diffstat (limited to 'libc/unistd')
-rw-r--r-- | libc/unistd/getpass.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/unistd/getpass.c b/libc/unistd/getpass.c index 92d3565c8..83b0140c7 100644 --- a/libc/unistd/getpass.c +++ b/libc/unistd/getpass.c @@ -45,7 +45,7 @@ getpass (prompt) /* Try to write to and read from the terminal if we can. If we can't open the terminal, use stderr and stdin. */ - in = fopen ("/dev/tty", "w+"); + in = fopen ("/dev/tty", "r+"); if (in == NULL) { in = stdin; @@ -61,7 +61,7 @@ getpass (prompt) /* Save the old one. */ s = t; /* Tricky, tricky. */ - t.c_lflag &= ~(ECHO|ISIG); + t.c_lflag &= ~(ECHO|ICANON|ISIG); tty_changed = (tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0); } else |