Article View: comp.sources.d
Article #57Re: v29i019: tin - threaded full screen newsreader v1.1P1, Part01/12
From: Adri Verhoef
Date: Wed, 08 Apr 1992 14:55
Date: Wed, 08 Apr 1992 14:55
39 lines
1746 bytes
1746 bytes
Tin has a built-in inews. When posting articles, the hostname is fetched by: #if defined(BSD) || defined(sinix) || defined(RS6000) gethostname (host_name, sizeof (host_name)); #else uname (host_name); #endif But this does not always resolve to the Fully Qualified Domain Name. My hostname is "tintin" (yes, double "tin" :-) and my domainname is rivm.nl. So, the call above puts "tintin" in host_name[], but lacks the domainname. I wrote a few C-lines to demonstrate what really should be there. See below. Furthermore, I think that it is not always desirable to have the hostname in the address, some people want to hide their hostnames, and they only want to see their domainnames in the address. This should be made into a compile-time option. Now for the few C-lines I wrote: In the BSD case (I can't speak for the others at the mo') I would like to see: **** #include <netdb.h> struct hostent *he; gethostname (host_name, sizeof (host_name)); he = gethostbyname(host_name); strcpy(host_name, he->h_name); **** Probably even use strncpy(), while you're at it. -- * Slade Mailing List: slade-request@rivm.nl * European top 20 : a3@rivm.nl * Nederlandse songfragmentenquiz: a3@rivm.nl (Adri Verhoef) * Dutch Artists Lyrics Quiz : a3@rivm.nl
Technical Details
Message-ID:
<1992Apr8.145532.13265@rivm.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!rivm!tintin.rivm.nl!a3Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!rivm!tintin.rivm.nl!a3 From: a3@tintin.rivm.nl (Adri Verhoef) Newsgroups: comp.sources.d Subject: Re: v29i019: tin - threaded full screen newsreader v1.1P1, Part01/12 Summary: hostname without domainname? Message-ID: <1992Apr8.145532.13265@rivm.nl> Date: 8 Apr 92 14:55:32 GMT Sender: news@rivm.nl Organization: Rijksinstituut voor Volksgezondheid en Milieuhygiene,Bilthoven,NL Lines: 39