home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / next / sysadmin / 6626 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.6 KB

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