From:	ADVAX::"mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM" "William H. Glass"  1-FEB-1991 18:43:32.82
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
CC:	
Subj:	Buffalo Chicken Wings and ANU-NEWS

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Fri, 1 Feb 91 18:42:03 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA17438 for ; Fri, 1 Feb 91 18:09:36 -0500
Received: from VM1.NoDak.EDU by mcnc.mcnc.org (5.59/MCNC/6-11-90)
	id AA25110; Fri, 1 Feb 91 17:43:45 -0500
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9102012243.AA25110@mcnc.mcnc.org>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 3146; Fri, 01 Feb 91 16:43:20 CST
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 8584; Fri, 01 Feb 91 16:43:17 CST
Date:         Thu, 31 Jan 91 07:42:22 GMT
Reply-To: "William H. Glass" <mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: "William H. Glass" <mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM>
Subject:      Buffalo Chicken Wings and ANU-NEWS
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
 
   If you read the Subject of this article, you're probably asking "What
do Buffalo Chicken Wings have to do with NEWS?"  Well, take a minute and
switch yourself to rec.food.cooking, and take a look at the directory for
articles posted last weekend (26th thru 28th).
 
   Back already?  Now you're probably saying "Boy, Buffalo Chicken Wings
is certainly a popular subject - there must be 200 postings on it".  WRONG!
To put it simply, there was a "killer article" posted in this category.
Every time it hit an ANU-NEWS site, it got split up into 4 articles.  The
first one didn't create a problem since it carried the original message-ID.
However, each ANU-NEWS site created a new message-ID for the other 3 pieces
and of course sent them back to the net.  The result was a flood of articles
on Buffalo Chicken Wings (and several irate people the next few days).  There
was a similar incident a couple weeks ago in gnu.emacs.help.
 
   There are two problems here: 1) Why is NEWS splitting the article up,
and 2) NEWS shouldn't be making up message-ID numbers and redistributing
articles.  I know the cause of both problems, but at the moment, I only
have a fix for the second.  6.0-1 is a lot better than earlier releases,
but it still has a couple of paths that can generate message-ID's.  The
patches at the end of this article will close those holes.  However, there
are times when it is desireable to have NEWS produce ID's (e.g., when
adding a mailing list).  I've added a /GENID switch to the ADD command that
will allow NEWS to automatically produce a message-ID for any article that
doesn't already have one.  Use this switch with care.  Typically, it should
only be used when you know that all the articles will be going into
newsgroups that have a restricted distribution.  This patch should also
eliminate the need for a patch posted recently by Lawrence Fisher
(fisher@edwards-vax.af.mil).
 
   While tracking down this problem, I also discovered and fixed a couple
other problems in NEWSADD.C.  They are:
 
   1) In some cases, NEWS would forward an article twice to a remote system.
Probably not a serious problem, and it could only happen on articles that
were getting put into JUNK on the local system.
 
   2) If an incoming article in a batch file didn't have either a body for
the article or a blank line to terminate the header, NEWS would ignore the
first line of the next article (typically the PATH line).
 
   What follows is a context diff file to changes NEWSADD.C (most of the
changes), and NEWSCMD.CLD (a one liner).  If you can't deal with this type
of file, let me know and I can either e-mail a complete NEWSADD.C or just
"selected highlights".  WARNING - this patch is only for version 6.0-1.
--
 
William H. Glass                        Internet: glass@mgi.com
Management Graphics, Inc.               Phone:    +1 (612) 854-1220
1401 E. 79th Street
Minneapolis, MN  55425
 
________________________________________________________________________________
 
*** newsadd.c;1
--- newsadd.c
**************
*** 101,107
 
  int do_add_net() { return(0); }
 
! #else
 
  extern
  int mailfile_open;
--- 101,107 -----
 
  int do_add_net() { return(0); }
 
! char *create_article(char *fn, char *xref) { return(NULL); }
 
  #else
 
**************
*** 103,108
 
  #else
 
  extern
  int mailfile_open;
 
--- 103,110 -----
 
  char *create_article(char *fn, char *xref) { return(NULL); }
 
+ #else
+
  extern
  int mailfile_open;
 
**************
*** 192,197
      no_add = 0,
      mod_add = 0,
      control_squelch = 0,
      temp_file_error = 0,
      loc_junk = 0;
 
--- 194,200 -----
      no_add = 0,
      mod_add = 0,
      control_squelch = 0,
+     genid = 0,
      temp_file_error = 0,
      loc_junk = 0;
 
**************
*** 221,227
    for (i = 0; i < NHEADERS; ++i) known_headers[i] = &(itm[i][0]);
    strcpy(newsgroup,ng);
    mail_add_expiry = parse_expiry_date(itm[EXPIRES]);
!   if (*itm[CONTROL] && !no_control) {
      strcpy(newsgroup,"control");
      if (   !skip_loop_test
          && (
--- 224,231 -----
    for (i = 0; i < NHEADERS; ++i) known_headers[i] = &(itm[i][0]);
    strcpy(newsgroup,ng);
    mail_add_expiry = parse_expiry_date(itm[EXPIRES]);
!   if (!*itm[MESSAGE_ID] && genid) strcpy(itm[MESSAGE_ID],gen_id());
!   if (*itm[CONTROL] && !no_control && *itm[MESSAGE_ID]) {
      strcpy(newsgroup,"control");
      if (   !skip_loop_test
          && (
**************
*** 253,258
      printf(": JUNK (No Newsgroup)");
      strcpy(newsgroup,junk);
      }
 
  #if SELF_PATH_CHECK
    if (!skip_loop_test && !mod_add && path_match(itm[PATH],news_pathname)) {
--- 257,266 -----
      printf(": JUNK (No Newsgroup)");
      strcpy(newsgroup,junk);
      }
+   if (!*itm[MESSAGE_ID]) {
+     printf(": REJECT (No Message-ID)\n");
+     return;
+     }
 
  #if SELF_PATH_CHECK
    if (!skip_loop_test && !mod_add && path_match(itm[PATH],news_pathname)) {
**************
*** 292,302
          }
        else {
          if (strcmp(newsgroup,junk)) {
-           if (!*itm_fname && !fn) {
-             if (!(fn = create_article(NULL,NULL))) return;
-             }
-           sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],
-                      ((*itm_fname) ? itm_fname : fn),itm[MESSAGE_ID],!mod_add)
;
            if (!junk_it) {
              printf(": REJECT (%s)\n",no_new_item);
              return;
--- 300,305 -----
          }
        else {
          if (strcmp(newsgroup,junk)) {
            if (!junk_it) {
              if (!*itm_fname && !fn && !(fn = create_article(NULL,NULL))) retur
n;
              sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],
**************
*** 298,303
            sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],
                       ((*itm_fname) ? itm_fname : fn),itm[MESSAGE_ID],!mod_add)
;
            if (!junk_it) {
              printf(": REJECT (%s)\n",no_new_item);
              return;
              }
--- 301,310 -----
        else {
          if (strcmp(newsgroup,junk)) {
            if (!junk_it) {
+             if (!*itm_fname && !fn && !(fn = create_article(NULL,NULL))) retur
n;
+             sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],
+                             ((*itm_fname) ? itm_fname : fn),
+                             itm[MESSAGE_ID],!mod_add);
              printf(": REJECT (%s)\n",no_new_item);
              return;
              }
**************
*** 342,349
      }
    if (*itm_fname) sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],
itm_fname,itm[MESSAGE_ID],!mod_add);
    else {
-     if (!fn && !(fn = create_article(NULL,NULL))) return;
-     sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],fn,itm[MESSAGE
_ID],!mod_add);
      if (strcmp(newsgroup,junk)) {
        if (!junk_it) {
          printf(": REJECT\n");
--- 349,354 -----
      }
    if (*itm_fname) sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],
itm_fname,itm[MESSAGE_ID],!mod_add);
    else {
      if (strcmp(newsgroup,junk)) {
        if (!junk_it) {
          if (!fn && !(fn = create_article(NULL,NULL))) return;
**************
*** 346,351
      sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],fn,itm[MESSAGE
_ID],!mod_add);
      if (strcmp(newsgroup,junk)) {
        if (!junk_it) {
          printf(": REJECT\n");
          return;
          }
--- 351,358 -----
    else {
      if (strcmp(newsgroup,junk)) {
        if (!junk_it) {
+         if (!fn && !(fn = create_article(NULL,NULL))) return;
+         sys_remote_send(itm[PATH],itm[NEWSGROUPS],itm[DISTRIBUTION],fn,itm[MES
SAGE_ID],!mod_add);
          printf(": REJECT\n");
          return;
          }
**************
*** 399,405
         head[30];
    int i;
 
-   if (!*itm[MESSAGE_ID]) strcpy(itm[MESSAGE_ID],gen_id());
    sprintf(oline,"%s%s %s VAX/VMS V%d.%d; site %s\n",fheaders[RELAY_VERSION],
          NEWS_VERSION,NEWS_DDATE, vms_major,vms_minor,Node_address);
    fout_line(oline,fpl);
--- 406,411 -----
         head[30];
    int i;
 
    sprintf(oline,"%s%s %s VAX/VMS V%d.%d; site %s\n",fheaders[RELAY_VERSION],
          NEWS_VERSION,NEWS_DDATE, vms_major,vms_minor,Node_address);
    fout_line(oline,fpl);
**************
*** 743,748
  #endif
      return(0);
      }
 
    if (first_get_call) {
      first_get_call = 0;
--- 749,755 -----
  #endif
      return(0);
      }
+   if (infile_eom) return(0);
 
    if (first_get_call) {
      first_get_call = 0;
**************
*** 1166,1171
    auto_cre_grp = cli$present(c$dsc("CREGRP")) & 1;
    del_after = (cli$present(c$dsc("DELETE")) & 1);
    skip_loop_test = cli$present(c$dsc("RETRY")) & 1;
 
    exec_opt = 0;
    exec_switch = 0;
--- 1173,1179 -----
    auto_cre_grp = cli$present(c$dsc("CREGRP")) & 1;
    del_after = (cli$present(c$dsc("DELETE")) & 1);
    skip_loop_test = cli$present(c$dsc("RETRY")) & 1;
+   genid = cli$present(c$dsc("GENID")) & 1;
 
    exec_opt = 0;
    exec_switch = 0;
*** newscmd.cld;1
--- newscmd.cld
**************
*** 200,205
      qualifier   ACCEPT      placement=positional,negatable
      qualifier   NEWSGROUP   placement=positional,value
      qualifier   NOCONTROL   nonnegatable
 
  define syntax ADD_ENTRY
      routine do_add_entry
--- 200,206 -----
      qualifier   ACCEPT      placement=positional,negatable
      qualifier   NEWSGROUP   placement=positional,value
      qualifier   NOCONTROL   nonnegatable
+     qualifier   GENID
 
  define syntax ADD_ENTRY
      routine do_add_entry
