[net.general] junk spewing out onto the net

mark@cbosgd.UUCP (10/18/83)

This message is aimed at Usenet administrators on each site.  I'm also putting
it on net.general because I'm unsure if net.news.adm gets to everywhere yet.

In the last day or so, two large sets of garbage messages have made it out
onto Usenet.  It's too late to stop them from going out (and saving on phone
bills) but the really annoying thing is people having to read these old
messages.  So I went in and added two options to the expire command to clean
out things based on the posting date, and on the author.  These two are useful
for the flood that just occurred.

I'm enclosing a diff from smk's recursive expire.  However, since the changes
are simple, it's easy to make them to just about any version of expire.

Recommended invocation:
	expire -p -v
	expire -f notes@zeppo.UUCP -v

The first one will clean out all the junk that came through cbdkc1!cbosgd
this morning, which was mostly posted in the last week of September but
managed to get logjammed somewhere along the line.  Since the posting Date
on these articles was over 2 weeks ago, they will be expired while keeping
the stuff that was posted recently.

The second one will remove anything posted by user notes@zeppo.UUCP.  Everything
from that user seems to have come out all at once, dated as far back as last
June, and I think I've all seen it before.  (Once again, some copy of notes
gets confused and the whole net gets innundated.)

Here are the diffs:

*** oexpire.c	Mon Oct 17 17:20:31 1983
--- expire.c	Mon Oct 17 17:18:56 1983
***************
*** 37,42
  int	doarchive = 0;
  int	nohistory = 0;
  int	rebuild = 0;
  
  /*
   * This code uses realloc to get more of the multhist array.

--- 37,45 -----
  int	doarchive = 0;
  int	nohistory = 0;
  int	rebuild = 0;
+ int	usepost = 0;
+ int	frflag = 0;
+ char	baduser[BUFLEN];
  
  /*
   * This code uses realloc to get more of the multhist array.
***************
*** 152,157
  			rebuild++;
  			nohistory++;
  			break;
  		default:
  			printf("Usage: expire [ -v [level] ] [-e days ] [-i] [-a] [-r] [-h] [-n newsgroups]\n");
  			exit(1);

--- 155,171 -----
  			rebuild++;
  			nohistory++;
  			break;
+ 		case 'p':
+ 			usepost++;
+ 			break;
+ 		case 'f':
+ 			frflag++;
+ 			if (argc > 2) {
+ 				strcpy(baduser, argv[2]);
+ 				argv++;
+ 				argc--;
+ 			}
+ 			break;
  		default:
  			printf("Usage: expire [ -v [level] ] [-e days ] [-i] [-a] [-r] [-h] [-n newsgroups]\n");
  			exit(1);
***************
*** 373,379
  checkdate:
  		if (h.expdate[0])
  			h.exptime = cgtdate(h.expdate);
! 		newtime = cgtdate(h.recdate) + expincr;
  		if (!h.expdate[0] || ignorexp == 2 || 
  		    (ignorexp == 1 && newtime < h.exptime))
  			h.exptime = newtime;

--- 387,393 -----
  checkdate:
  		if (h.expdate[0])
  			h.exptime = cgtdate(h.expdate);
! 		newtime = cgtdate(usepost ? h.subdate : h.recdate) + expincr;
  		if (!h.expdate[0] || ignorexp == 2 || 
  		    (ignorexp == 1 && newtime < h.exptime))
  			h.exptime = newtime;
***************
*** 377,383
  		if (!h.expdate[0] || ignorexp == 2 || 
  		    (ignorexp == 1 && newtime < h.exptime))
  			h.exptime = newtime;
! 		if (now >= h.exptime) {
  #ifdef DEBUG
  			printf("cancel %s\n", filename);
  #else

--- 391,397 -----
  		if (!h.expdate[0] || ignorexp == 2 || 
  		    (ignorexp == 1 && newtime < h.exptime))
  			h.exptime = newtime;
! 		if (frflag ? strcmp(baduser,h.from)==0 : now >= h.exptime) {
  #ifdef DEBUG
  			printf("cancel %s\n", filename);
  #else

	Mark Horton