home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1405 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  2.8 KB

  1. From: scott@zorch.SF-Bay.ORG (Scott Hazen Mueller)
  2. Newsgroups: alt.sources,news.admin
  3. Subject: After the last bunch of BIFFishness...
  4. Message-ID: <1990Jun3.211456.8805@zorch.SF-Bay.ORG>
  5. Date: 3 Jun 90 21:14:56 GMT
  6.  
  7. Since the last rash of BIFF forged newgroups has given everyone fits, I'll
  8. repost my hacked C news newgroup and rmgroup scripts.  These scripts fake
  9. B news-style mail messages that give the originator of the control message,
  10. a subject line with the newsgroup name (and the moderated keyword), and include
  11. the control message text (if any) in the notifying mail message.  When the
  12. BIFF struck, Zorch.SF-Bay.ORG, my home site, and Tandem.COM, where I work, were
  13. both secure to the extent that all that happened was gobs and gobs of junk
  14. mail.
  15.  
  16. Enjoy,
  17. -- 
  18. Scott Hazen Mueller | scott@zorch.SF-Bay.ORG or (ames|pyramid|vsi1)!zorch!scott
  19. 10122 Amador Oak Ct.|(408) 253-6767     |Mail fusion-request@zorch.SF-Bay.ORG
  20. Cupertino, CA  95014|Love make, not more|for emailed sci.physics.fusion digests
  21. SF-Bay Public-Access Unix 408-996-7358/61/78/86 login newuser password public
  22.  
  23. ----- cut here for newgroup -----
  24. #! /bin/sh
  25. # newgroup group flag - create group (4-field version: B-2.10.3+ compatible)
  26. #    subject to our sys file group pattern
  27.  
  28. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  29. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  30. export NEWSCTL NEWSBIN NEWSARTS
  31. PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH # include mkpdir
  32. umask $NEWSUMASK
  33.  
  34. afile=/tmp/ncd
  35. afilehdr=/tmp/ncdhdr
  36. afilebody=/tmp/ncdbody
  37. hdr=/tmp/nc$$
  38.  
  39. trap "rm -f $hdr $afile*; exit 0" 0
  40. $NEWSBIN/inject/tear $afile
  41. $NEWSBIN/canonhdr <$afilehdr >$hdr
  42.  
  43. # unapproved ctl msg? then quit
  44. grep -s '^Approved:' $hdr >/dev/null || { rm -f $hdr; exit 0; }
  45.  
  46. SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`"
  47. case "$SENDER" in
  48. "")    SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//' `" ;;
  49. esac
  50.  
  51. ( echo "Subject: newgroup $1 $2"; echo "$SENDER says:";
  52. cat $afilebody ) | mail $NEWSMASTER
  53.  
  54. ----- cut here for rmgroup -----
  55.  
  56. #! /bin/sh
  57. # rmgroup group - snuff group
  58.  
  59. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  60. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  61. export NEWSCTL NEWSBIN NEWSARTS
  62. PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  63. umask $NEWSUMASK
  64.  
  65. afile=/tmp/ncd
  66. afilehdr=/tmp/ncdhdr
  67. afilebody=/tmp/ncdbody
  68. hdr=/tmp/nc$$
  69.  
  70. $NEWSBIN/inject/tear $afile
  71. $NEWSBIN/canonhdr <$afilehdr >$hdr
  72.  
  73. # unapproved ctl msg? then quit
  74. egrep '^Approved:' $hdr >/dev/null || { rm -f $afile*; exit 0; }
  75.  
  76. # quit if no active entry
  77. egrep "^`echo $1 | sed 's/\./\\\\./g'` " $NEWSCTL/active >/dev/null ||
  78.     { rm -f $hdr $afile*; exit 0; }
  79.  
  80. SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`"
  81. case "$SENDER" in
  82. "")    SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//'`" ;;
  83. esac
  84.  
  85. # tell the local usenet administrator to do it by hand
  86. ( echo "Subject: rmgroup $1"; echo "$SENDER says:";
  87. cat $afilebody ) | mail $NEWSMASTER
  88.  
  89. rm -f $hdr $afilehdr $afilebody
  90.