[comp.unix.questions] getlogin

lenny@icus.UUCP (Lenny Tropiano) (08/15/88)

In article <578@proxftl.UUCP> aaron@proxftl.UUCP (Aaron Zimmerman) writes:
|>I have a curious problem on my 3b1...
|>
...
|>$ who am i
|>aaron      w4           Aug 12 08:01
|>$ passwd
|>Changing password for LOGIN
|>Permission denied.
...

The problem occurs not in passwd (or the /etc/passwd file), but in the
getlogin(3C) function call.    This problem occurs if you use multiple
getty's on /dev/window, or you have something running on w1 when the
getty respawns for /dev/window.

The following example with show this:

lenny    + w1           Aug 14 20:05   .     4428  
root     + w4           Aug 14 21:51   .     5623  

(Note:  I'm logged in with two gettys, the current one is w4).

# tty
/dev/w4
# passwd
Changing password for lenny
New password: [...]

getlogin(3C) looks up the /dev/window login finding the first entry in
/etc/utmp it finds.  I maybe logged in on w4 as root, but getlogin thinks
I am logged in as lenny on w1.  In your case with user LOGIN, it found was a
LOGIN_PROCESS.	(A "getty" process waiting for login)

Something like:

LOGIN    + window       Aug 14 21:54   .     5880  
root     + w4           Aug 14 21:51   .     5623  

Those are the disadvantages in running multiple gettys, although having
the capability to login more than once is nice. (Something I'm working into
the window-manager I am rewriting).

-Lenny
-- 
Paper-net: Lenny Tropiano          | @-net:         lenny@icus.UUCP
           ICUS Software Systems   | !-net:      ...sbcs   \
           PO Box 1                |                boulder \
           Islip Terrace, NY 11752 |                talcott  !icus!lenny
Vocal-net: (516) 582-5525 [work]   |                pacbell /
           (516) 968-8576 [home]   |                hombre /
Telex-net: 154232428 ICUS          | Another-net:   attmail!icus!lenny

woods@gpu.utcs.toronto.edu (Greg Woods) (08/16/88)

In article <467@icus.UUCP> lenny@icus.UUCP (Lenny Tropiano) writes:
>In article <578@proxftl.UUCP> aaron@proxftl.UUCP (Aaron Zimmerman) writes:
>|>I have a curious problem on my 3b1...
>|>
>...
>|>$ who am i
>|>aaron      w4           Aug 12 08:01
>|>$ passwd
>|>Changing password for LOGIN
>|>Permission denied.
>...
>
>The problem occurs not in passwd (or the /etc/passwd file), but in the
>getlogin(3C) function call.    This problem occurs if you use multiple
>getty's on /dev/window, or you have something running on w1 when the
>getty respawns for /dev/window.

I've also had this problem with 386/ix, when a getty in the LOGIN state
dies abnormally.  A 'who -a' shows LOGIN and xyzzy both on the port, but
it gives an exit status for LOGIN.

I'd call this a bug (and I will bug-report it too).  The problem occurs
with any utility that calls getlogin(3C), including mail, etc.
-- 
						Greg Woods.

UUCP: utgpu!woods, utgpu!{ontmoh, ontmoh!ixpierre}!woods
VOICE: (416) 242-7572 [h]		LOCATION: Toronto, Ontario, Canada

fr@icdi10.uucp (W. Fred Rump) (08/19/88)

I tried posting some mail to the chief Xenix basher in the land but the
customs guys must have grabbed it.

Does he really work for his own constulting group?
-- 
{allegra killer gatech!uflorida decvax!ucf-cs}!ki4pv!cdis-1!cdin-1!icdi10!fr    
or ...{bellcore!bpa rutgers!bpa}!cdin-1!icdi10!fr 
or...!bikini.cis.ufl.edu!ki4pv!cdis-1!cdin-1!icdi10!fr