Subject: getty/login problem
To: None <netbsd-help@NetBSD.ORG>
From: Phil Nelson <phil@steelhead.cs.wwu.edu>
List: port-pc532
Date: 03/13/1997 21:33:01
I'm having a strange problem I thought I'd ask and see if anyone else
on any version of NetBSD has seen before.  I'm seeing this on
NetBSD/pc532 -current.

It has to do with getty and login.  The following are the excerpts
from gettytab and ttys.

---- gettytab ----

default:\
        :np:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:

g|std.19200|19200-baud:\
        :sp#19200:

--- ttys ----
console "/usr/libexec/getty std.19200"  tvi950-rv on secure local cs8 softcar -parenb

----------

Here is what happens: (This is a serial line console.)

  When getty is running and I do "stty -a < /dev/console" it reports
"cs8 -parenb -parodd" to be part of cflags.  Input and output appear
to work just fine and I can enter my user name.

  When I get the "Password:" prompt, "stty -a < /dev/consle" reports
"cs7 parenb -parodd".  So in reading the password, it ignores the
characters with the wrong parity and I can not login on console. 

  So, I decided to ktrace getty to see if I could find something ...
and discovered something interesting ...

  The following is an excerpt from where getty prints the console
login message and where it reads the user name.  It appears as if
the input is "cs8 -parenb -parodd" but the output is "cs7 -parenb
-parodd".  That is the way I have to interpret the \M-p as being
a "p" with the high bit on, giving even parity.  Also, notice how
the read returns "p" but the echo is "\M-p".

  3954 getty.save CALL  write(0x1,0x48e4,0x2f)
  3954 getty.save GIO   fd 1 wrote 47 bytes
       "\M^M
        NetBSD\M-/\M-pc53\M-2\240(\M-steel\M-he\M-a\M-d\M-)\240(co\M-n\M-sole\
        \M-)\M^M
        \M^M
        lo\M-gi\M-n:\240"
  3954 getty.save RET   write 47/0x2f
  3954 getty.save CALL  read(0,0xf7bfff37,0x1)
  3954 getty.save GIO   fd 0 read 1 bytes
       "p"
  3954 getty.save RET   read 1
  3954 getty.save CALL  write(0x1,0x48e4,0x1)
  3954 getty.save GIO   fd 1 wrote 1 bytes
       "\M-p"
  3954 getty.save RET   write 1
  3954 getty.save CALL  read(0,0xf7bfff37,0x1)
  3954 getty.save GIO   fd 0 read 1 bytes
       "h"
  3954 getty.save RET   read 1
  3954 getty.save CALL  write(0x1,0x48e4,0x1)
  3954 getty.save GIO   fd 1 wrote 1 bytes
       "\M-h"
  3954 getty.save RET   write 1
  3954 getty.save CALL  read(0,0xf7bfff37,0x1)
  3954 getty.save GIO   fd 0 read 1 bytes
       "i"
  3954 getty.save RET   read 1
  3954 getty.save CALL  write(0x1,0x48e4,0x1)
  3954 getty.save GIO   fd 1 wrote 1 bytes
       "i"
  3954 getty.save RET   write 1
  3954 getty.save CALL  read(0,0xf7bfff37,0x1)
  3954 getty.save GIO   fd 0 read 1 bytes
       "l"
  3954 getty.save RET   read 1
  3954 getty.save CALL  write(0x1,0x48e4,0x1)
  3954 getty.save GIO   fd 1 wrote 1 bytes
       "l"
  3954 getty.save RET   write 1
  3954 getty.save CALL  read(0,0xf7bfff37,0x1)
  3954 getty.save GIO   fd 0 read 1 bytes
       "\r"
  3954 getty.save RET   read 1
  3954 getty.save CALL  sigaction(0x2,0xf7bfff10,0xf7bfff04)
  3954 getty.save RET   sigaction 0
  3954 getty.save CALL  write(0x1,0x48e4,0x2)
  3954 getty.save GIO   fd 1 wrote 2 bytes
       "\M^M
       "
  3954 getty.save RET   write 2

So when login then gets the settings to turn echo off, it must get the
setting for the output and then turn the input to the same settings.

-- 
Phil Nelson
phil@steelhead.cs.wwu.edu (NetBSD/pc532 machine)
phil@cs.wwu.edu (work)
http://www.cs.wwu.edu/~phil