Xref: utzoo comp.sys.att:1808 comp.unix.wizards:5649
Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!jade!ig!uwmcsd1!marque!chinet!ignatz
From: ignatz@chinet.UUCP (Dave Ihnat)
Newsgroups: comp.sys.att,comp.unix.wizards
Subject: Re: getlogin(3C) returns bogus name
Message-ID: <1977@chinet.UUCP>
Date: 11 Dec 87 16:17:36 GMT
References: <74@quincy.UUCP>
Reply-To: ignatz@chinet.UUCP (Dave Ihnat)
Organization: Chinet - Public Access Unix
Lines: 12
Keywords: getlogin, username, login

Yep; I've seen this one, when I was porting 'mdm'.  I'll bet you're
running more than one shell login window.  It seems that getlogin() isn't
quite swift enough to differentiate between the physical device--probably
'console'--and the virtual windows 'w1', 'w2', etc. on that device; so
it'll return whatever it finds first in /etc/utmp.  I haven't spent
the time yet to yank the object out of the library, rewrite it, stuff
it back in the library, etc.  Not to mention having to muddle around
in the shared library...
-- 
			Dave Ihnat
			ihnp4!homebru!ignatz || ihnp4!chinet!ignatz
			(w) (312) 882-4673