[13710] in Athena Bugs
/source/athena/bin/login forcibly sets the baud rate to 9600
daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Wed Aug 2 20:22:42 1995
Date: Wed, 2 Aug 1995 20:22:32 -0400
From: Theodore Ts'o <tytso@MIT.EDU>
To: bugs@MIT.EDU
Cc: jweiss@MIT.EDU, cfields@MIT.EDU
/bin/login (source in /source/athena/bin/login) forcibly sets
the baud rate to 9600. This is wrong, and it breaks serial line logins.
The getty program (or in the case of Solaris, ttymon) is responsible for
setting the baudrate of the tty correctly.
In fact, most getty/ttymon programs usually go to heroic lengths
to figure out what the buad rate is and change it to use the correct
baud rate automatically. This allows the first "login: " prompt printed
by the getty/ttymon program to be output at the correct baud rate.
However, after the user types his/her password, and getty/ttymon
transfers control to /bin/login, our /bin/login then forcibly sets the
baud rate to 9600 baud, making it impossible for the user to type his or
her password unless they happened to be connecting at 9600 baud in the
first place. (Not likely, especially when the serial port is connected
to a V.34 modem!)
Fortunately, the patch to fix this is quite simple:
*** login.c.old Fri Jan 27 04:58:26 1995
--- login.c Wed Aug 2 19:21:45 1995
***************
*** 483,490 ****
tio.c_iflag |= (BRKINT|IGNPAR|ISTRIP|IXON|IXANY|ICRNL);
tio.c_oflag |= (OPOST|TAB3|ONLCR);
! tio.c_cflag &= ~(CSIZE|CBAUD);
! tio.c_cflag |= (CS8|B9600|CREAD|HUPCL|CLOCAL);
tio.c_lflag |= (ICANON|ISIG|ECHO|ECHOE|ECHOK);
tio.c_cc[VINTR] = CINTR;
tio.c_cc[VQUIT] = CQUIT;
--- 483,489 ----
tio.c_iflag |= (BRKINT|IGNPAR|ISTRIP|IXON|IXANY|ICRNL);
tio.c_oflag |= (OPOST|TAB3|ONLCR);
! tio.c_cflag |= (CREAD|HUPCL|CLOCAL);
tio.c_lflag |= (ICANON|ISIG|ECHO|ECHOE|ECHOK);
tio.c_cc[VINTR] = CINTR;
tio.c_cc[VQUIT] = CQUIT;
I've made this patch before under Ultrix before, and I'm currently
running with this patch under Solaris, and it fixes the problem without
introducing any new ones. We should test and make sure AIX doesn't do
something funky which requires that the baud rate be forced to 9600; it
wouldn't make any sense, but that hasn't necessarily stopped IBM before. :-)
- Ted