Subject: Re: bin/30295
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Hubert Feyrer <hubert@feyrer.de>
List: netbsd-bugs
Date: 05/26/2005 23:57:01
The following reply was made to PR bin/30295; it has been noted by GNATS.

From: Hubert Feyrer <hubert@feyrer.de>
To: gnats-bugs@netbsd.org
Cc: wiz@netbsd.org
Subject: Re: bin/30295
Date: Fri, 27 May 2005 01:56:42 +0200 (CEST)

 Christos wrote:
 >  . most other unixes do it this way.
 
 At least on Solaris 9/x86 with "telnet localhost", you can enter ~256 
 chars, and then the system beeps on any extra char you type.
 Sounds much more sane to me than jumping to ask for a password.
 
 The patch below does what Solaris does - any further keystrokes beyond 
 LOGIN_NAME_MAX replace the last char, and beep.
 
 Poking in the CVS logs, the code was touched in 1999 in rev. 1.28 for soe 
 cosmetics, but the real test goes back to rev. 1.1 in 1993.
 
 
   - Hubert
 
 Index: main.c
 ===================================================================
 RCS file: /cvsroot/src/libexec/getty/main.c,v
 retrieving revision 1.47
 diff -u -r1.47 main.c
 --- main.c	17 Mar 2005 01:25:40 -0000	1.47
 +++ main.c	26 May 2005 23:48:43 -0000
 @@ -503,12 +503,15 @@
 
   		if (c == EOT)
   			exit(1);
 -		if (c == '\r' || c == '\n' ||
 -		    np >= &name[LOGIN_NAME_MAX - 1]) {
 +		if (c == '\r' || c == '\n') {
   			*np = '\0';
   			putf("\r\n");
   			break;
   		}
 +		if (np >= &name[LOGIN_NAME_MAX - 1]) {
 +			putf("\a\b \b");
 +			np--;
 +		}
   		if (islower(c))
   			lower = 1;
   		else if (isupper(c))
 
 -- 
 Genervt von Viren und von Viren versandten Spam-Mails?  -> www.NetBSD.de
 Fed up from viruses & virus-originated spam mail?       -> www.NetBSD.org