getlogin() problem (was Re: username problem)

Lenny Tropiano lenny at icus.UUCP
Mon Aug 15 12:02:40 AEST 1988


In article <578 at proxftl.UUCP> aaron at 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 at 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



More information about the Comp.unix.questions mailing list