Spawning a login on a pty

Michael Richardson michael at fts1.uucp
Tue Aug 14 04:16:13 AEST 1990


In article <177 at hafro.is> heimir at hafro.is (Heimir Sverrisson) writes:
>I did try to double-fork to make the /etc/getty an orphan, then
>I made it a process group leader (using setpgrp(2)) -- still w.o.
>any luck.

  That isn't enough.

>At last I got the damn thing to work by writing a 'fake' utmp
>entry to /etc/utmp using pututline(3). Then the problem is to keep
>the utmp-entry up to date, i.e. when the user logs out of the pty.

  You have to go to that extent, which (if you don't want your
program to be setuid root, or at least setgid sys) means a writtable
/etc/utmp.

  I have yet to figure out how to mark a utmp entry as 'unused' -- I have
a feeling that /etc/init rewrites the file. After mucking about with things,
I managed to leave a bogus utmp entry for /dev/ttyd0, and that screwed up 
uucico (LOGNAME didn't match...)

>My question to the net is:  Is this the way to go?  How do window-
>managers, telnetd and rlogind do this?  How portable is it, will it
>work in BSD environment, POSIX, AIX, MACH ?

  Suns usually have writtable /etc/utmp files, at least for SunTools.
I've noticed that Shell Layers (shl) CHANGES the utmp entry. Unfortunately,
it changes it to 'sxt001' (instead of 'sxt/001', of course, /bin/tty is broken
anyway, unless you link /dev/sxt/* to /dev/sxt*)

>I'll summarize if I get any usable answers.

  None from me. Maybe someone has the answer...

-- 
   :!mcr!:            | < political commentary currently undergoing Senate >
   Michael Richardson | < committee review. Returning next house session.  >
 Play: mcr at julie.UUCP Work: michael at fts1.UUCP Fido: 1:163/109.10 1:163/138
    Amiga----^     - Pay attention only to _MY_ opinions. -   ^--Amiga--^



More information about the Comp.unix.i386 mailing list