This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

B19: fgets from /dev/tty with echo off broken


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 <Petr.Novak@i.cz>
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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]