home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / admin / 4560 < prev    next >
Encoding:
Text File  |  1992-08-17  |  3.3 KB  |  84 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!destroyer!terminator!stat.lsa.umich.edu!william
  3. From: william@stat.lsa.umich.edu (William Pietri)
  4. Subject: Re: Where can I find a "fingerd" that fingers the person back?
  5. Message-ID: <1992Aug17.171935.23127@terminator.cc.umich.edu>
  6. Sender: news@terminator.cc.umich.edu (Usenet Owner)
  7. Organization: University of Michigan Department of Statistics
  8. References: <1992Aug14.210137.24157@csus.edu> <1992Aug15.022526.14014@Princeton.EDU>
  9. Distribution: usa
  10. Date: Mon, 17 Aug 1992 17:19:35 GMT
  11. Lines: 71
  12.  
  13. In article <1992Aug15.022526.14014@Princeton.EDU>, spencer@stroke.Princeton.EDU (S. Spencer Sun) writes:
  14. > In article <1992Aug14.210137.24157@csus.edu>, tching@target.water.ca.gov (Tracy Ching <SysAdmin>) writes:
  15. > >    I want to know who is "finger"ing me (no jokes please...)
  16. > >and I want it to keep a log.
  17. > AAAAAAAAAAAAARRRRRRRRRRGGGGGGGGGHHHHHHHHH!!!!!!!!!!!!
  18. > From the frequency with which similar questions arise, I would guess
  19. > that no such fingerd has been written, but if you write one, I suggest
  20. > you definitely post it because there seem to be a lot of people who
  21. > would like to have it (I'm not one of them though)
  22.  
  23. There's a version of GNU Finger that's been cleaned up by the folks at
  24. ICSI.  (It looks like that it is available at icsi.berkeley.edu in
  25. pub/stolcke/icsi-finger-1.0.11.tar.Z.)  If you tell it to use m4
  26. instead of cpp as the macro processor for plan files, then this plan
  27. should do what you want:
  28.  
  29. === begin m4 file ===
  30. divert(10)
  31. define(username,william)
  32. define(tempfile,maketemp(/tmp/username.XXXXX))
  33. define(lockfile,maketemp(/tmp/username.fingerlock))
  34.  
  35. syscmd(cat lockfile) define(locktestval,sysval())
  36. syscmd(touch lockfile)
  37.  
  38. syscmd(echo -n "Finger request at " >> tempfile)
  39. syscmd(date >> tempfile)
  40. syscmd(echo -n "on host " >> tempfile)
  41. syscmd(hostname >> tempfile)
  42. syscmd(echo >> tempfile ; echo "Reciprocal request yielded this:" >> tempfile)
  43. syscmd(echo >> tempfile)
  44.  
  45. ifelse(LOCAL,1,`
  46.   syscmd(/usr/local/bin/finger  >> tempfile)
  47. ',`
  48.   ifelse(locktestval,1,`
  49.     syscmd(/usr/local/bin/finger @PEERNAME >> tempfile)
  50.   ',`
  51.     syscmd(echo "Finger already in progress." >> tempfile)
  52.     syscmd(echo "Host PEERNAME not checked." >> tempfile)
  53.   ')
  54. ')
  55. syscmd(/usr/ucb/mail -s "+fingered" username < tempfile)
  56. syscmd(rm -f tempfile)
  57. syscmd(rm -f lockfile)
  58. divert(0)sinclude(.realplan)dnl
  59. === end m4 file ===
  60.  
  61. This m4 file fingers the site (not the user) from which the finger
  62. request was received and mails the user with the result.  It then shows
  63. the text in the file .realplan to the remote user.  I was worried about
  64. loopback problems from berserk finger servers, so this script creates a
  65. lock file and refuses to finger the remote site if a request for this
  66. user is already in progress.
  67.  
  68. Even if you have no interest in semi-paranoid scripts like this, I
  69. still encourage you to install ICSI's version of finger at your site;
  70. it knows how to collect information from a group of machines and
  71. display it in a variety of useful ways.  To see what it looks like you
  72. can finger @icsi.berkely.edu (and also try fingering .help@icsi).
  73.  
  74. William
  75.  
  76. -- 
  77. William Pietri            | Email: William.Pietri@umich.edu
  78. Stat. Dept. Sysadmin and    |    or: william@stat.lsa.umich.edu
  79.    ITD/CSS Consultant        |    or: USERW28W@UMICHUM.bitnet
  80. University of Michigan        | Phone: (313) 764-9983
  81.