[net.news.b] "rmgroup net" stupidity

parmelee@bullwinkle.cs.cornell.edu (Larry Parmelee) (05/01/86)

Did anyone else out there get bit by the recent "newgroup/rmgroup net"
exchange?  I haven't seen any comments; Is it just that everyone else
is still recovering?

Our arrangement here is that we have one main news machine that communicates
with the rest of usenet, and many other campus sites that are fed by the
main news machine.  The main machine doesn't trust "rmgroups" received
from the rest of the net, but most of our other machines do, if only
to make central administration easier.  A few days ago, the "rmgroup net"
message arrived, and all our leaf nodes dutifully executed the
/usr/lib/news/rmgroup script, which bops around and eventually does
"rm -r net".  Poof!  There goes all of net.all.all.all....   Needless to
say, there's a few users around who are mildly concerned....  One
consolation though, we now have plenty of free space on our disks....

What I'd like to see, is a way for our main machine to filter all control
messages for the rest of the machines on campus.  Prehaps we'd create a 
locally moderated group for control messages.  The leaf machines would
only respond to properly approved control messages received in this
group.  Probably there is a need to allow some messages through
unquestioned, like the cancel article messages.  Anyone have any
thoughts on how hard it'd be to do something like this?  We're
currently running a variety of versions of news;  The main machine is
running 2.10.3, and so are most of the leafs.

My interm solution is to modify the rmgroups script  (this is probably
appropriate for earlier versions of news than just 2.10.3... the
heading on rmgroup says '@(#)rmgroup.sh       1.4     12/27/84', so
its been around a while.)  The intent of these mods is:  When removing
say "net.group", first only ordinary files (not directories!) in
SPOOLDIR/net/group/* are removed, and finally a simple "rmdir" is done
on SPOOLDIR/net/group/.  This rmdir will fail (thank goodness!) if
SPOOLDIR/net/group/ is not empty, i.e. if net.group happened to have
a subgroup.  Also, any articles in any subgroups are untouched.
Comments, anyone?  Here's a diff -c.

	-Larry Parmelee
	

*** rmgroup.sh.OLD	Thu May  1 07:32:43 1986
--- rmgroup.sh	Thu May  1 07:30:33 1986
***************
*** 17,23 ****
  		if
  			[ -d "$dir" ]
  		then
! 			rm -r "$dir"
  		else
  			echo "$0: $dir: no spool directory" 2>&1
  		fi
--- 17,31 ----
  		if
  			[ -d "$dir" ]
  		then
! 			for f in "$dir"/*
! 			do
! 				if 
! 					[ -f "$f" ]
! 				then
! 					rm -f "$f"
! 				fi
! 			done
! 			rmdir "$dir"
  		else
  			echo "$0: $dir: no spool directory" 2>&1
  		fi