Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: getlogin(3C) returns bogus name Message-ID: <6868@ncoast.UUCP> Date: 19 Dec 87 19:23:23 GMT References: <10848@brl-adm.ARPA> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 29 As quoted from <10848@brl-adm.ARPA> by jlunny@NSWC-G.arpa: +--------------- | i've noticed this problem within the AT&T environment on a Pyramid. | The problem would surface in some of my background processes. it is a | bug in getlogin(), but it was decided it was not important enough to | be fixed here at this site (like alot of Pyramid's little quirks, but who's | here to complain). +--------------- The problem on the Pyramid is probably a bad translation of a BSD /etc/utmp (I assume you boot using BSD files rather than AT&T files; I'm told one could use either) to AT&T format. On the 3B1 (the original problem), the problem is caused by the fact that the only way to create a new window is to open /dev/window, which metamorphoses into a /dev/w[0-9] automagically. Needless to say, this is cleaner for a program than the way used to get e.g. ptys, but requires rooting through /dev if the program wants the name of the *real* window device it's using. (On 3.51 it seems to work correctly; my "w", at least, says I'm logged in on "w1", and it *doesn't* do any mucking around with window devices.) A quick fix: "ln" /dev/window to "/dev/wdev01" and "/dev/wdev02", then set up a getty on each. However, this can backfire if someone writes to a user from the console -- if "write" doesn't track windows the respondent could end up writing to an otherwise-empty window.... -- Brandon S. Allbery necntc!ncoast!allbery@harvard.harvard.edu {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery Moderator of comp.sources.misc