From:	ADVAX::"mcnc!VM1.NoDak.EDU!jeh%CMKRNL.UUCP" 12-JUN-1991 23:45:14.21
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
CC:	
Subj:	RE: Misuse, confusion, re "Distribution:" header?

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Wed, 12 Jun 91 23:42:18 EDT
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA13548 for ; Wed, 12 Jun 91 22:42:39 -0400
Received: from VM1.NoDak.EDU by mcnc.mcnc.org (5.59/MCNC/3-21-91)
	id AA07544; Wed, 12 Jun 91 20:20:18 -0400
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9106130020.AA07544@mcnc.mcnc.org>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 4310; Wed, 12 Jun 91 19:19:18 CDT
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 5208; Wed, 12 Jun 91 19:19:17 CDT
Date:         Wed, 12 Jun 1991 15:53:44 GMT
Reply-To: mcnc!VM1.NoDak.EDU!jeh%CMKRNL.UUCP
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: mcnc!VM1.NoDak.EDU!jeh%CMKRNL.UUCP
Subject:      RE: Misuse, confusion, re "Distribution:" header?
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
 
In article <9106110330.AA18224@jatz.aarnet.edu.au>, G.Huston@AARNET.EDU.AU write
s:
> the refinements continue - if d_sav is reset as above (correctly), for
> the while loop, then it must be set back to the original value of d
> for the outer do loop
>
> i.e. the declaraction of d_sav should read
>
> line 628:
>
>
>    *d_sav = d, *dd_sav = d;
>
>
> and the lines 703 onward are now:
>
>
>       if (!d && (d_sav != f_sav)) {
>          d = f_sav;
>          d_sav = f_sav;
>          }
>        }
>       d_sav = dd_sav;
>     if (ngaccept == 1) accept = 1;
>     cp1 = cp2;
>    } while ((!accept) && cp1));
>   return(accept);
> }
>
 
A stylistic note:  No offense, Geoff, but this is approaching "miserable hack"
status (not that my fix by itself was any cleaner, you just fixed my fix!).
 
In retrospect, setting a "saved pointer" to zero, using its zero-ness as a
flag, and then restoring it is bad practice; a separate flag is better.
 
What about this (this is context diff'd against the original 6.0-3 version):
 
*** [-.newsv60-3.news_src]newsdist.c
--- DUB2:[UUCP.NEWS60.NEWS_SRC]NEWSDIST.C;86
**************
*** 13,19
  **      Geoff Huston
  **
  **  COPYRIGHT:
! **      Copyright ) 1989,1990
  **
  **
  **  CONTRIBUTIONS
--- 13,19 -----
  **      Geoff Huston
  **
  **  COPYRIGHT:
! **      Copyright ) 1989,1990,1991
  **
  **
  **  CONTRIBUTIONS
**************
*** 26,31
  **      sys_accept_group(newsgroup)
  **      sys_remote_send(path,newsgroups,distribution,item_file,message_id,net)
  **      path_match(path,news_node)
  **--
  **/
 
 
 
 
 
 
 
 
 
 
--- 26,36 -----
  **      sys_accept_group(newsgroup)
  **      sys_remote_send(path,newsgroups,distribution,item_file,message_id,net)
  **      path_match(path,news_node)
+ **
+ **  VERSION HISTORY
+ **    V6.0-4  30/4/91 gh
+ **            Modify filter acceptance algorithm to match distribution
+ **            keywords against newsgroup filter list.
  **--
  **/
 
 
 
 
 
 
 
 
 
 
**************
*** 619,625
         locname[NGRP_SIZE],
         wname[NGRP_SIZE],
         line[IO_SIZE];
!   int accept = 0, ngaccept;
    SYS_FILTER_T *f_sav = f,
                 *d_sav = d;
 
--- 624,630 -----
         locname[NGRP_SIZE],
         wname[NGRP_SIZE],
         line[IO_SIZE];
!   int accept = 0, ngaccept, used_f_sav;
    SYS_FILTER_T *f_sav = f,
                 *d_sav = d;
 
**************
*** 665,670
      if (cp2 = strchr(cp1,',')) *cp2++ = '\0';
      util_cvrt(locname,cp1);
      d = d_sav;
      ngaccept = 0;
      while (d) {
        if (*d->sys_filtnam == '!') {
--- 670,676 -----
      if (cp2 = strchr(cp1,',')) *cp2++ = '\0';
      util_cvrt(locname,cp1);
      d = d_sav;
+     used_f_sav = 0;
      ngaccept = 0;
      while (d) {
        if (*d->sys_filtnam == '!') {
**************
*** 692,697
            }
          }
        d = d->sys_fnext;
        }
      if (ngaccept == 1) accept = 1;
      cp1 = cp2;
--- 698,711 -----
            }
          }
        d = d->sys_fnext;
+               /* some brain-dead news systems put the top level
+                  hierarchy in as the distribution keyword - so the
+                  newsgroup filter should also be matched against
+                  the distribution string */
+       if (!d && (d_sav != f_sav) && !used_f_sav) {
+          d = f_sav;
+          used_f_sav = 1;
+          }
        }
      if (ngaccept == 1) accept = 1;
      cp1 = cp2;
 
NOTE, context patch will probably report that the first "hunk" failed.
The eight-bit copyright character does not make it intact through news
software.
 
        --- Jamie Hanrahan, Kernel Mode Consulting, San Diego CA
Chair, VMS Internals Working Group, U.S. DECUS VAX Systems SIG
Internet:  jeh@dcs.simpact.com, hanrahan@eisner.decus.org, or jeh@crash.cts.com
Uucp:  ...{crash,scubed,decwrl}!simpact!cmkrnl!jeh
