Path: utzoo!utstat!helios.physics.utoronto.ca!jarvis.csri.toronto.edu!cs.utexas.edu!usc!jarthur!polyslo!hoyt From: hoyt@polyslo.CalPoly.EDU (Sir Hoyt) Newsgroups: news.software.b Subject: Re: C news configuration options vs B news same Message-ID: <1989Dec5.183224.27127@polyslo.CalPoly.EDU> Date: 5 Dec 89 18:32:24 GMT References: <1989Dec5.080052.3532@aai.uucp> <1989Dec5.172135.27648@utzoo.uucp> Reply-To: hoyt@polyslo.CalPoly.EDU (Sir Hoyt) Organization: WanderLand, San Luis Obispo Lines: 84 In article <1989Dec5.172135.27648@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <1989Dec5.080052.3532@aai.uucp> leo@aai.UUCP (Leo Pinard) writes: >>NONEWGROUPS - sends mail instead of creating groups > >This one isn't the default, since we consider group creation relatively >harmless. We haven't got a terribly convenient way of changing this, >although one that will certainly work is to just remove the shell program >($NEWSBIN/ctl/newgroup) that does new-group creation; that will result >in a complaint via mail when such a control message arrives. A tidier >but more complicated alternative is to change the shell program to >implement whatever policy you want. Find attached a version of $NEWSBIN/ctl/newsgroup that send mail to $NEWSMASTER about new group creation control message. ( Don't forget to remove the 'X' from the begining of the line ) ------------------ CUT HERE --------------------- CUT HERE --------------------- X#! /bin/sh X# newgroup group flag - create group (4-field version: B-2.10.3+ compatible) X# subject to our sys file group pattern X X# =()<. ${NEWSCONFIG-@@}>()= X. ${NEWSCONFIG-/usr/local/lib/news/bin/config} Xexport NEWSCTL NEWSBIN NEWSARTS XPATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH # include mkpdir Xumask $NEWSUMASK X Xhdr=/tmp/nc$$ X Xtrap "rm -f $hdr; exit 0" 0 Xcanonhdr >$hdr X X# unapproved ctl msg? then quit Xgrep -s '^Approved:' $hdr >/dev/null || { rm -f $hdr; exit 0; } X XSENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`" Xcase "$SENDER" in X"") SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//' `" ;; Xesac X Xgreppat="^`echo $1 | sed 's/\./\\\\./g' ` " Xif grep -s "$greppat" $NEWSCTL/active >/dev/null; then # group exists? X export SENDER X chamod "$1" "$2" # change moderated flag if needed X exit Xfi X Xme="`newshostname`" Xgngppat=`awk -f $NEWSBIN/relay/canonsys.awk $NEWSCTL/sys | X egrep "^($me|ME):" | X awk -F: ' X{ X fields = split($2, field2, "/") # split ngs/dists X print field2[1] # print only ngs X exit X}' ` X Xif gngp -a "$gngppat" >/dev/null < /tmp/mail$$ X echo " " >> /tmp/mail$$ X echo "$SENDER request that newsgroup $1 be created." >> /tmp/mail$$ X echo "The group should be $MOD" >> /tmp/mail$$ X echo "The group can be made with the following command: " >> /tmp/mail$$ X echo " " >> /tmp/mail$$ X echo "$NEWSBIN/maint/addgroup $1 $flag" >> /tmp/mail$$ X echo " " >> /tmp/mail$$ X /usr/ucb/mail -s "Newsgroup $1 creation request" $NEWSMASTER < /tmp/mail$$ X rm -f /rmp/mail$$ X Xfi -- John H. Pochmara A career is great, UUCP: {sdsu,voder,trwind}!polyslo!hoyt But you can't run your Internet: hoyt@polyslo.CalPoly.EDU fingers through its hair -Graffiti 4/13/83