Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Apr 1997 09:46:49 +1000
From:      David Nugent <davidn@unique.usn.blaze.net.au>
To:        Alex Belits <abelits@phobos.illtel.denver.co.us>
Cc:        Adrian Chadd <adrian@staff.psinet.net.au>, freebsd-hackers@freebsd.org
Subject:   Re: Best way to hook into user logins / logouts ? 
Message-ID:  <199704232346.JAA20594@unique.usn.blaze.net.au>
In-Reply-To: Your message of "Wed, 23 Apr 1997 02:16:57 MST." <Pine.LNX.3.95.970423021141.26011A-100000@phobos.illtel.denver.co.us> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > For what I'm working on I need to hook into when users login and logout.
> > The "best" way I can find currently is hooking into the wtmp updates in
> > libc (especially for the logouts), does anyone know any better ways?
> 
>   That will be completely broken for xterm.

No, it works fine for xterm, unless you've disabled wtmp/utmp
logging by using -ut or the equivalent resource.

> Actually it all depends on what "login" is, and for all imaginable
> needs you can use /etc/profile or wrapper as user shell (and
> defined in /etc/shells) that exec's real shell.

Both methods which are flawed, since they run as the user, and therefore
can be interfered with by the user (for example, the user can rerun
the utility, or interfere with the data it writes). The answer to that,
of course, is using setuid perl scripts or programs, and we all know
how much fun they are.

Watching wtmp/utmp is probably the best "hands off" approach to take,
plus it only relies on the accuracy of wtmp. It gets both ends of the
session, and the "hangup" end is often the most important.

Regards,

David Nugent - Unique Computing Pty Ltd - Melbourne, Australia
Voice +61-3-9791-9547  Data/BBS +61-3-9792-3507  3:632/348@fidonet
davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704232346.JAA20594>