Subject: B19: fgets from /dev/tty with echo off broken
From: [email-masked] (Petr Novak)

25 Sep 1998 20:07:39 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: [email-masked]

Hi,

I was trying to port SSH-1.2.26 with minimal changes under cygwin32. I am
using B19 tools & runtime.

The major problem I have is that reading the passphrase from terminal
fails and sometimes even freezes the Win95 kernel. I am using W95, I did
not try Windows NT.

When you turn echo off using tcsetattr and read a line using fgets, the
fgets works fine while reading from stdin assigned to console, but loops
until the buffer is overflown while reading from FILE *p =
fopen("/dev/tty", "r").

It might have something to do with CRLF conversion not being done
properly, as the fgets routine expects to find a \n or fills up the
buffer.

Pressing CTRL-BREAK or CTRL-C sometimes stops the program with
signal 2, sometimes does not produce any result (and it is possible to
close the BASH window from which the process was started) and sometimes
hangs the whole W95 kernel.

Any idea where the problem is? I was trying to debug the fgets, ___fill...
and other routines, but I was not able to do it properly.

Thanks in advance,

--
Petr Novak <[email-masked]>
ICZ a.s.
Zirovnicka 6
CZ-106 00 Praha 10
Ph:  +420 2 2424 5124
Fax: +420 2 2424 5125

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".