Subject: Re: long usernames
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 02/19/2003 13:17:59
> if you're not waiting for the Password: prompt before typing your
> password, then you should start waiting!  there's really nothing
> else you can do.
> 
> i imagine the reason that it happens at system boot and after idle
> is that what happens is:  getty prints "login:" and reads your
> username, and then exec /usr/bin/login with that name, and it is
> login that prints "Password:".  thus, the first time that getty
> exec's login, it's probably never run login before so has to page
> in parts of it, etc., and also after idle time login's pages have
> almost certainly been flushed from core memory, thus need to be
> paged in again.

I started looking at this.
getty has echo turned off (at least the code looks as though it is
doing its own echoing and line editing).
There is an option as to whether echo is turned on before login is execed.
I'm not sure of the state of this [1]
Login does a load of work before asking for the password,  if the tty
has echo enabled there is plenty of time for you to type something
you shouldn't...

	David

[1] I've built a kernel that will ktrace ioctl buffers, this generates
the unparseable:
  1602 stty     CALL  ioctl(0,TIOCGETA,0xeffff9a0)
  1602 stty     GIO   fd 0 wrote 44 bytes
	"\0\0+\^B\0\0\0\a\0\0K\0 \0\^E\M-K\^D\M^?\M^?\^?\^W\^U\^R\M^?\^C\^\\^Z\
	\^Y\^Q\^S\^V\^O\^A\0\^T\M^?\0\0\M^V\0\0\0\M^V\0"
So I pasted it into 'printf '%b' "xxxxx" | hexdump -c' only to find that
printf as aborting on the first null.  I've just fixed that.

-- 
David Laight: david@l8s.co.uk