[net.news.b] Slight bug with leading white space in sys file.

tim@pilchuck.UUCP (The Daemon's Slave) (09/27/86)

Version:  "B 2.10.3 4.3bsd-beta 6/6/85" and probably others.

Priority: LOW (if your a careful editor)

Description:
        If any leading whitespace appears in a sys file line for a  site
        then a lot of unwanted news  transfers can occur.  Say  "SITE_A"
        is sending you batched  news and you  only send local  unbatched
        articles to "SITE_A".   In your sys file  you might have a  line
        like ...

	ME:all::                   # Incoming news

	" SITE_A:all::"            # Outgoing news
			    (Note the unintentional leading white space)
                               (put there because of fat fingers :-)

        When news now arrives from "SITE_A", inews installs the  article
        on the local system  and then retransmits it  back to "  SITE_A"
        (Note the  space again).    Now uux  doesn't care  whether  it's
        "SITE_A" or " SITE_A"  that your sending  to so everything  gets
        shipped right  back  to  "SITE_A"  where it  came  from  but  as
        individual, non batched, non compressed articles!!!

Fix:
        After a line has been read in  from the sys file and before  any
        parsing is done  on that  line, make  sure there  is no  leading
        whitespace.  The following context  diff contains the patch  for
        the file funcs2.c.   The  line numbers might  not exactly  match
        your copy but the patch is only a two line addition so it  could
        easily be done by hand.

*** funcs2.c.orig	Fri Sep 26 14:49:37 1986
--- funcs2.c	Fri Sep 26 14:55:45 1986
***************
*** 94,99
  		return FALSE;
  	}
  	p = bfr;
  	if (*p == '\n')
  		goto again;	     /* skip newlines */
  	if (!nstrip(p))

--- 94,101 -----
  		return FALSE;
  	}
  	p = bfr;
+ 	while (*p == ' ' || *p == '\t')   /* remove any leading whitespace */
+ 		p++;
  	if (*p == '\n')
  		goto again;	     /* skip newlines */
  	if (!nstrip(p))
-- 
-----
....microsoft--\                           Tim Rosmus (Sys Admin)
...uw-beaver-----!tikal!pilchuck!tim       Data I/O Corporation
....fluke------/                           10525 Willows Road N.E.
....hplsla----/                            P.O. Box 97046
....motsea---/                             Redmond, WA  98073-9746
                                           (206) 881-6444