[news.software.b] Wrong Path in articles under C News

mike@apex.yorku.ca (Mike Marques) (05/16/91)

Greetings...

I've just installed C News (24-MAR-1991) and NNTP (1.5.11) under
Ultrix 4.1.  Things work just fine except articles posted locally have
the local host twice in their Path: field:

Path: newshub.ccs.yorku.ca!newshub.ccs.yorku.ca!mike

Can this cause problems?  If someone could point me to documentation
or explain how to fix this I'd greatly appreciate it.
(I saw nothing in the documentation about this.)
Thanks...

							Mike


--
          Mike Marques               )(  Usenet: ......!utzoo!yunexus!mike 
 Computing & Communications Services )(          mike@outland.yorku.ca
   (IT division),  York University.  )(  Bitnet: mike@yulibra
   Only visiting this planet...      )(  Voice: (416) 736-5257

henry@zoo.toronto.edu (Henry Spencer) (05/16/91)

In article <MIKE.91May15171725@apex.yorku.ca> mike@apex.yorku.ca (Mike Marques) writes:
>... Things work just fine except articles posted locally have
>the local host twice in their Path: field:
>
>Path: newshub.ccs.yorku.ca!newshub.ccs.yorku.ca!mike

This probably means that whatever software is being used to do the posting
is supplying its own Path header, which is a stupid mistake but does happen.
The C News posting machinery is respecting the existing path and just adding
the local name on the front.

The fix is to fix the posting software.  This just might be NNTP's fault
if you are posting through it, but whatever you're using as reader/poster
is more likely to be at fault.

It's relatively harmless.
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry@zoo.toronto.edu  utzoo!henry

henry@zoo.toronto.edu (Henry Spencer) (05/16/91)

In article <MIKE.91May16104542@apex.yorku.ca> mike@apex.yorku.ca (Mike Marques) writes:
>>   This probably means that whatever software is being used to do the posting
>>   is supplying its own Path header...
>
>That's what I thought at first so I tried the postnews supplied (but
>unsupported I realize :-) ) with C-news but this happens as well.
>As far as I can tell postnews does not produce a path header and just
>passes the stuff to inews.  This means that I probably managed to
>mangle something in C-news itself...

Something's odd, anyway.  You are correct in thinking that our postnews
does not try to be clever.
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry@zoo.toronto.edu  utzoo!henry

mike@apex.yorku.ca (Mike Marques) (05/16/91)

In article <1991May15.224905.985@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:

>   This probably means that whatever software is being used to do the posting
>   is supplying its own Path header, which is a stupid mistake but does happen.
>   The C News posting machinery is respecting the existing path and just adding
>   the local name on the front.
>
>   The fix is to fix the posting software.  This just might be NNTP's fault
>   if you are posting through it, but whatever you're using as reader/poster
>   is more likely to be at fault.

That's what I thought at first so I tried the postnews supplied (but
unsupported I realize :-) ) with C-news but this happens as well.
As far as I can tell postnews does not produce a path header and just
passes the stuff to inews.  This means that I probably managed to
mangle something in C-news itself.  I'll have to trace it sometime
soon whan I have the time.

							Mike

--
          Mike Marques               )(  Usenet: ......!utzoo!yunexus!mike 
 Computing & Communications Services )(          mike@outland.yorku.ca
   (IT division),  York University.  )(  Bitnet: mike@yulibra
   Only visiting this planet...      )(  Voice: (416) 736-5257

per@erix.ericsson.se (Per Hedeland) (05/17/91)

In article <1991May15.224905.985@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>In article <MIKE.91May15171725@apex.yorku.ca> mike@apex.yorku.ca (Mike Marques) writes:
>>... Things work just fine except articles posted locally have
>>the local host twice in their Path: field:
>>
>>Path: newshub.ccs.yorku.ca!newshub.ccs.yorku.ca!mike
>
>This probably means that whatever software is being used to do the posting
>is supplying its own Path header, which is a stupid mistake but does happen.

The "stupidity", if any, is most likely not a mistake, but an attempt
(futile, I know), to make the Path: header usable for mail replies -
when posting over NNTP, the poster need not even have an account on the
server host, and so the posting program provides a 'Path: posting-host!user'
line. Perhaps the posting program should detect that posting-host is
equal to nntpserver, and skip the Path: in this case, but I don't know
of any that does.

>The fix is to fix the posting software.  This just might be NNTP's fault
>if you are posting through it, but whatever you're using as reader/poster
>is more likely to be at fault.

Nntpd just passes the bytes to inews; the mini-inews that comes with the
NNTP distribution does create a Path: header in certain circumstances, though.

>It's relatively harmless.

Agreed, but it's ugly and space-wasting - and easily fixable in C news,
of course - the fix (to relay/hdrmunge.c) that isn't one is appended
below, but somehow I don't expect it to show up in the official
patches:-).

--Per Hedeland
per@erix.ericsson.se  or
per%erix.ericsson.se@uunet.uu.net  or
...uunet!erix.ericsson.se!per

*** /tmp/,RCSt1a03848	Thu May 16 23:32:31 1991
--- hdrmunge.c	Sun Apr 28 12:04:49 1991
***************
*** 177,205 ****
  {
  	if (CISTREQN(hdr, pathhdr.hdrnm, (int)pathhdr.hdrlen)) {
  		register char *oldpath, *hostnm = hostname();
  
  		oldpath = skipsp(&hdr[pathhdr.hdrlen]);
- 		/*
- 		 * V7 f?printf return 0 or EOF, not a byte count, so it is
- 		 * not portable to use fprintf's return value as a byte count.
- 		 */
- 		if (fprintf(art->a_artf, "%s %s!", pathhdr.hdrnm, hostnm) ==
- 		    EOF || fputs(oldpath, art->a_artf) == EOF)
- 			fulldisk(art, spoolnm(art));
- 		else {
- 			static unsigned hostlen = 0;
  
! 			if (hostlen == 0)
! 				hostlen = strlen(hostnm);
! 			art->a_charswritten += pathhdr.hdrlen + STRLEN(" ") +
! 			    hostlen + STRLEN("!") + strlen(oldpath);
  		}
- 	} else {
- 		if (fwrite(hdr, hdrlen, 1, art->a_artf) != 1)
- 			fulldisk(art, spoolnm(art));
- 		else
- 			art->a_charswritten += hdrlen;
  	}
  }
  
  /*
--- 187,224 ----
  {
  	if (CISTREQN(hdr, pathhdr.hdrnm, (int)pathhdr.hdrlen)) {
  		register char *oldpath, *hostnm = hostname();
+ 		static unsigned hostlen = 0;
  
+ 		if (hostlen == 0)
+ 		    hostlen = strlen(hostnm);
  		oldpath = skipsp(&hdr[pathhdr.hdrlen]);
  
! 		/* Don't add our name to Path: if it's already there
! 		   (may happen e.g. with NNTP posters) - B news doesn't... */
! 		if (strncmp(hostnm, oldpath, hostlen) != 0 ||
! 		    strlen(oldpath) <= hostlen ||
! 		    oldpath[hostlen] != '!') {
! 			/*
! 			 * V7 f?printf return 0 or EOF, not a byte count,
! 			 * so it is not portable to use fprintf's return
! 			 * value as a byte count.
! 			 */
! 			if (fprintf(art->a_artf, "%s %s!",
! 				    pathhdr.hdrnm, hostnm) == EOF ||
! 			    fputs(oldpath, art->a_artf) == EOF)
! 			    fulldisk(art, spoolnm(art));
! 			else {
! 				art->a_charswritten +=
! 				    pathhdr.hdrlen + STRLEN(" ") +
! 				    hostlen + STRLEN("!") + strlen(oldpath);
! 			}
! 			return;
  		}
  	}
+ 	if (fwrite(hdr, hdrlen, 1, art->a_artf) != 1)
+ 	    fulldisk(art, spoolnm(art));
+ 	else
+ 	    art->a_charswritten += hdrlen;
  }
  
  /*

timk@wynnds.xenitec.on.ca (Tim Kuehn) (05/17/91)

In article <MIKE.91May15171725@apex.yorku.ca> mike@apex.yorku.ca (Mike Marques) writes:
>Greetings...
>
>I've just installed C News (24-MAR-1991) and NNTP (1.5.11) under
>Ultrix 4.1.  Things work just fine except articles posted locally have
>the local host twice in their Path: field:
>
>Path: newshub.ccs.yorku.ca!newshub.ccs.yorku.ca!mike
>
>Can this cause problems?  If someone could point me to documentation
>or explain how to fix this I'd greatly appreciate it.
>(I saw nothing in the documentation about this.)
>Thanks...
>

Have you looked in the specs for your machine name and the domain 
name that it's hiding behind? Don't quote me on this, but f you put
newshub.ccs.yorku.ca in for both the machine and domain name, you may 
get the problem you describe.

I'd check the /usr/lib/news/whoami file to see if there's something 
strange in there, as well as anything else that could have the machine or
user name in it. (mailpaths maybe?)

------------------------------------------------------------------------ 
Tim Kuehn			 TDK Consulting Services  (519)-888-0766
timk@wynnds.xenitec.on.ca  -or-  !{watmath|lsuc}!xenitec!wynnds!timk
Valpo EE turned loose on unsuspecting world! News at 11!
"You take it seriously when someone from a ballistics research lab calls you."
Heard at a Unix user's meeting discussing connectivity issues.