COM32 libutil: Fix error in flags in console_ansi_std(void)
authorGene Cumm <gene.cumm@gmail.com>
Sun, 15 Feb 2009 22:24:49 +0000 (17:24 -0500)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 16 Feb 2009 00:34:33 +0000 (16:34 -0800)
commita34a0f89fc0b6f06e5958d3b3a2a0f09ced81a81
treeb062fe66bf84d9ba37f51fa0cd8f97b89981732e
parent26830a4972f3f45a142d00e1d1ad221f6657629f
COM32 libutil: Fix error in flags in console_ansi_std(void)

ICANON and ECHO were applied to the control flags not local flags.

If ICANON or ECHO were applied to a serial port on Linux on the x86
architecture, this would change the serial ports baud rate.

From my /usr/include/bits/termios.h (select in-order lines):
/* c_cflag bit meaning */
#define  B150 0000005
#define  B300 0000007
#define  B9600 0000015
#define  B38400 0000017
/* c_lflag bits */
#define ICANON 0000002
#define ECHO 0000010

The different baud rates are defined here.  If someone set the baud
rate to 9600 and set ICANON on c_cflag, it should change the baud rate
to 38400, dropping communication.  Another example is if someone set
the baud rate to 150 the set ICANON and ECHO on c_cflag, it should
change the baud to 38400.  If I am interpreting the rest of the file
correctly, a bitmask covering all of the bits used in c_cflag for the
baud rate is 0010017.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/libutil/ansiline.c