[news.software.b] What do I put in Path?

david@wiley.UUCP (David Hull) (02/22/90)

I noticed this problem when I was installing NNTP the other day,
as we are getting ready to convert to domainized names on our network.

If a user on random posts an article over NNTP to the NNTP server, then
the NNTP mini-inews puts

Path: random!user

into the header of the article.  Unfortunately, we have made no attempt
to make sure that random is unique in the comp.sys.maps namespace, and
if there is a collision, then that other random and any hosts which may
be on the other side of USENET from it will never see the article.

It seems that the right thing to do is to put a domainized hostname
in the Path.  Currently, hostname is the nickname, but /etc/hosts
has the full name, i.e.,

0.0.0.0		random.my.domain random

I made a trivial change to inews/uname.c to look the canonical name up
in the hosts database.  This has the secondary advantage that the From
line now contains the right thing even if the client and the server are
in different domains.  The patch follows.

I wonder how much of a problem this is in the real world?

-David
					---------------------------------------
					David Hull  TRW Inc.  Redondo Beach, CA
					     david%wiley.uucp@csvax.caltech.edu
						...!{uunet,cit-vax}!wiley!david

*** inews/uname.c-	Mon Jun 26 21:37:02 1989
--- inews/uname.c	Thu Feb 15 19:58:50 1990
***************
*** 32,41 ****
--- 32,51 ----
  #endif /* UNAME */
  
  #ifdef GHNAME
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ 
  uname(uptr)
  char	*uptr;
  {
+ 	struct hostent *he;
+ 
  	gethostname(uptr, 256);
+ 
+ 	he = gethostbyname(uptr);
+ 	strncpy(uptr, he->h_name, 255);
+ 	uptr[255] = '\0';
  }
  # define DONE
  #endif