[unix-pc.bugs] Bug in init or login? Duplicate utmp entries on the UNIX PC.

lenny@icus.islp.ny.us (Lenny Tropiano) (11/06/88)

This has happened quite a few times here, and it's not happening, to
my knowledge, at my other "local" unix-pc neighbors.  I believe there is
a serious bug in init that will corrupt the /etc/utmp file.   For some
reason when init respawns the [uu]getty for my Trailblazer it *sometimes*
will not find the correct line in the /etc/utmp file, and create another
duplicate line entry.  I believe the correct sequence of events for 
init would be to use pututline(3C) to rewrite the utmp entry.  
pututline(3C) uses getutid(3C) to search forward for the proper place
if it finds that is not already at the proper place.  I think that 
getutid(3C) uses ttyslot(3C) to match the /etc/inittab's id with the line
in the /etc/utmp file.

The bug (for which I'm told is being worked on for the FIXDISK 2.0 which
is currently unavailable) will do this to your /etc/utmp file.

   .       system boot  Oct 23 15:44
   .       run-level 2  Oct 23 15:44    2    0    S
rc              .       Oct 23 15:55  old       4  id=  rc term=0   exit=0  
   .       old time     Oct 30 03:04
   .       new time     Oct 30 03:04
Uquincy  + tty001       Nov  5 17:19   .    11624     <-- entry #1
lenny    + w1           Nov  5 12:19   .     8804  
LOGIN    + tty000       Nov  5 16:35  0:54  11271  
LOGIN    + tty001       Nov  5 17:19   .    11637     <-- entry #2

Notice the two lines with tty001.  Hmmm, I think that init is not doing a
setutent(3C) before doing the pututline(3C).  setutline(3C) resets the
input stream to the beginning of the file.  I assume if this isn't done
and the input stream pointer is past the entry, it will inadvertently
create a duplicate entry.   Another possibility is that the bug occurs
in login, which again doesn't find the correct entry in the /etc/utmp
when you login.  It looks like it might have created another entry 
for "Uquincy" even though the LOGIN_PROCESS entry was present.

Is anyone having this problem?  If so, is there a way to prevent it
from happening before AT&T get's their FIXDISK out the door?

-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 582-5525
lenny@icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny  attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752