[uClibc]getpass() prints password after hitting enter

Manuel Novoa III mjn3 at codepoet.org
Mon Apr 8 21:09:12 UTC 2002


Vadim,

On Sun, Apr 07, 2002 at 03:18:33PM +0400, Vadim Berkgaut wrote:
> Hi,
> 
> I have the same problem. It seems that fopen opens /dev/tty
> in block buffering mode, because setting input stream to

No... fopen opens /dev/tty in line-buffered mode.  I've confirmed
that while testing.

> line buffering fixes it:
> 
> +      setvbuf(in, NULL, _IOLBF, 0);

That says to use a 0-length buffer... which is equivalent to
no buffering at all.  Since the underlying problem is with the
buffer handling, not using a buffer allows getpass() to avoid the
bug in the stdio code.

Manuel



More information about the uClibc mailing list