[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug or missing feature in who
From: |
Micah Cowan |
Subject: |
Re: Bug or missing feature in who |
Date: |
Fri, 25 May 2007 11:37:13 -0700 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070403) |
Andreas Schwab wrote:
> address@hidden (Bob Proulx) writes:
>
>> Alexander Schestag wrote:
>>> So, is there a way to tell "who" to list the users logged in via su
>>> as well?
>> Not with who. AFAIK you would need to walk the process list for that
>> information. There is really nothing special about a login process.
>> It is just a normal process.
>
> Actually a login process is kind of special, because it creates a new
> session and becomes the leader of it. Changing the user with su, on the
> other hand, does not create a new session (use ps -ej to display the
> session id of every process). Still, it is the sole responsibility of
> the process creating the session to update the utmp/wtmp information.
> In other words, you cannot trust this information in any way.
Not to mention that it's trivially easy to create a new session, and
many programs do it as a matter of course (especially dæmons). The
"create new session" syscall is generally used to disassociate from
whatever terminal and process group it was running under, so it won't
accidentally try to write to the terminal while it's in the background
(STOPping it); and won't receive SIGHUP if that terminal goes away.
--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/