Path: utzoo!dciem!nrcaer!fts1!michael From: michael@fts1.uucp (Michael Richardson) Newsgroups: comp.unix.i386 Subject: Re: Spawning a login on a pty Keywords: login, pty, i386 Message-ID: <1990Aug13.181613.1976@fts1.uucp> Date: 13 Aug 90 18:16:13 GMT References: <177@hafro.is> Organization: Fountain Technical Services, Ottawa, ON Lines: 38 In article <177@hafro.is> heimir@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@julie.UUCP Work: michael@fts1.UUCP Fido: 1:163/109.10 1:163/138 Amiga----^ - Pay attention only to _MY_ opinions. - ^--Amiga--^