Article View: comp.sys.next.sysadmin
Article #1904Re: loginwindow hooks- ARGHHHH!!!!
From: Wade Blomgren
Date: Fri, 20 Nov 1992 21:42
Date: Fri, 20 Nov 1992 21:42
24 lines
1669 bytes
1669 bytes
In an article, lemson@ux1.cso.uiuc.edu (David Lemson) writes: > > The $1 argument to LoginHook is the userid (name) of the user who is > logging in. I do not think that LogoutHook gets this information > passed to it as well (but would be happy to be proven wrong! It > would make life simpler). This is under 2.x, I haven't tried Hooks > in 3.0 yet. In 2.2, LogoutHook does get the user name passed as $1 (argv[1]). Further, the LogoutHook _is_ run as the user...if you want to use it to write a privileged file, the program will have to be setuid. Another poster says that these hooks are not needed since logins are automatically put in /usr/adm/wtmp. This is NOT true for console logins (at least in 2.2), so you do need to write your own hooks to handle it. As stated, though, shell scripts are probably not the best idea (but that argument is usually directed against _setuid_ shell scripts, not just ordinary shell scripts - there are tons of ordinary shell scripts routinely run unattended by root.) I can post the tiny LoginHook and LogoutHook C programs I use to handle wtmp if anyone cares... Wade Blomgren wade@hobbes.ucsd.edu
Technical Details
Message-ID:
<1ejm4pINNg7l@network.ucsd.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!swrinde!network.ucsd.edu!hobbes!wadeReferences:
<1992Nov19.191653.29086@schbbs.mot.com> <By08zy.Bw2@ux1.cso.uiuc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!swrinde!network.ucsd.edu!hobbes!wade From: wade@hobbes.ucsd.edu (Wade Blomgren) Newsgroups: comp.sys.next.sysadmin Subject: Re: loginwindow hooks- ARGHHHH!!!! Date: 20 Nov 1992 21:42:49 GMT Organization: University of California, San Diego Lines: 24 Message-ID: <1ejm4pINNg7l@network.ucsd.edu> References: <1992Nov19.191653.29086@schbbs.mot.com> <By08zy.Bw2@ux1.cso.uiuc.edu> NNTP-Posting-Host: hobbes.ucsd.edu