Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: hacknews Subject: getty(8) made more resistant to line noise Message-ID: <4309@utzoo.UUCP> Date: Wed, 12-Sep-84 17:59:00 EDT Article-I.D.: utzoo.4309 Posted: Wed Sep 12 17:59:00 1984 Date-Received: Wed, 12-Sep-84 17:59:00 EDT Organization: U of Toronto Zoology Lines: 26 Getty(8) has been modified to prevent the well-known phenomenon in which the wtmp file bloats ridiculously in the presence of a noisy line. As near as we can figure it out, this problem is caused like this: 1. Getty is basically throwing away characters with framing errors, which is why getty piles up cpu time in the presence of line noise. 2. When getty gets 16 characters or so without framing errors, it thinks it's got a login name. (The next-char loop terminates on array overflow as well as on an explicit newline.) So it gets things set up to invoke login. 3. Among other setup chores, it sets the tty into cooked mode. Framing errors are now taken as interrupts. 4. A framing error destroys the getty, causing init to write a logoff record and fork a new getty. Two changes have been made to getty. First, array overflow no longer terminates the get-login-name loop; it just recycles the array pointer back to the beginning of the array. Second, getty sets SIGINT to "ignored" before flipping the tty into cooked mode. (This doesn't hurt login(1), since login does the same thing with SIGINT immediately on invocation.) -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry