Subject: Bug#3227: login refuses, and then allows, root login on tty?

From: [email-masked]
Date: Wed, 5 Jun 96 16:43 EDT

Package: login
Version: 1.0-4

I installed this login package yesterday. Five minutes ago, I tried to login
on tty1 as root to check the new modconf out. "Root login refused." I was
puzzled and read some man pages. I also checked my /etc/securetty _but did
not change a thing_.

Being stubborn, I tried again. And succeeded with a login.  Is this really
the intended behaviour?

Here's the piece from /var/adm/auth.log:

Jun  5 16:29:20 miles login: LOGIN root REFUSED ON TTY tty??
Jun  5 16:29:49 miles last message repeated 2 times
Jun  5 16:38:11 miles login: ROOT LOGIN ON tty1

--
Dirk Eddelb"uttel                             http://qed.econ.queensu.ca/~edd

---

From: [email-masked]
Date: Thu, 6 Jun 1996 09:34:16 +0200 (MET DST)

> Being stubborn, I tried again. And succeeded with a login.  Is this really
I don't think so, but it sounds familiar. other users can use the tty but
root can't. Has this something to do with that sys(k)logd thing?

Erick Branderhorst

---

From: Michael Nonweiler <[email-masked]>
Date: Fri, 7 Jun 1996 06:55:59 +0100 (BST)

> root can't. Has this something to do with that sys(k)logd thing?

No.

The error message is "root login not allowed..." etc. ie.  /etc/securetty
problem, but /etc/securetty is correct, and things soon start to work... 
I don't think syslog problems could cause this.

I had this problem too, when I first installed a clean 1.1 installation.
It just went away of it's own accord for me too.  Odd.

Cheers,

Michael.

---

From: Guy Maor <[email-masked]>
Date: Fri, 7 Jun 1996 06:15:51 -0500 (CDT)

> I don't think syslog problems could cause this.

This line from Dirk's auth.log is illuminating.  Note the last 2
characters:
Jun  5 16:29:20 miles login: LOGIN root REFUSED ON TTY tty??

The ?? means that the call to ttyname(0) returned NULL.  The man page
for ttyname() says it can fail if the fd is not connected to a
terminal.  I'll have to check libc if there are other ways that it
could fail.

Which getty execed this login?  Also give me the initab line for this
tty.

Guy

---

From: [email-masked]
Date: Fri, 7 Jun 96 07:35 EDT

Guy>  This line from Dirk's auth.log is illuminating.  Note the last 2
  Guy> characters: Jun 5 16:29:20 miles login: LOGIN root REFUSED ON TTY
  Guy> tty??
  Guy>
  Guy> The ?? means that the call to ttyname(0) returned NULL.  The man page
  Guy> for ttyname() says it can fail if the fd is not connected to a
  Guy> terminal.  I'll have to check libc if there are other ways that it
  Guy> could fail.
  Guy>
  Guy> Which getty execed this login?  Also give me the initab line for this
  Guy> tty.

Plain standard:

edd@miles:~> dpkg -l getty sysvinit | grep ^ii
ii  getty           1.0-4          agetty, an alternative Linux getty.
ii  sysvinit        2.61-2         System-V like init.

edd@miles:~> grep tty /etc/inittab
# /sbin/getty invocations for the runlevels.
# characters of the device (after "tty").
1:2345:respawn:/sbin/getty 9600 tty1
2:23:respawn:/sbin/getty 9600 tty2
# edd 12.09.95 commented out 4 of the 6 getty's
#3:23:respawn:/sbin/getty 9600 tty3
#4:23:respawn:/sbin/getty 9600 tty4
#5:23:respawn:/sbin/getty 9600 tty5
#6:23:respawn:/sbin/getty 9600 tty6

---

From: [email-masked] (Austin Donnelly)
Date: Fri, 7 Jun 96 17:32 BST

>terminal.  I'll have to check libc if there are other ways that it

Not necessarily; in my experience with utmp, a line of '??' means
that utmp has somehow become corrupted. These entries should
really be marked as UT_DEAD (or whatever the flag should be for
the type).

There is a race _somewhere_; leading to these out-of-date utmp
entries. I haven't been able to track it down yet :(

Austin