Debian bug report logs -
#910, boring messages
Message sent to debian-devel@pixar.com:
Subject: Bug#910: INN has bad behaviour wrt DNS &c on occasionally-connected system
Reply-To: iwj10@cus.cam.ac.uk (Ian Jackson), debian-bugs@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: iwj10@cus.cam.ac.uk (Ian Jackson)
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Thu, 25 May 1995 11:18:13 GMT
Resent-Message-ID: <debian-bugs-handler.910.05251117026959@pixar.com>
X-Debian-PR-Package: inn
X-Debian-PR-Keywords:
Received: via spool for debian-bugs; Thu, 25 May 1995 11:18:13 GMT
Received: with rfc822 via encapsulated-mail id 05251117026959;
Thu, 25 May 1995 11:17:03 GMT
Received: from pixar.com by mongo.pixar.com with smtp
(Smail3.1.28.1 #15) id m0sEaol-00060BC; Thu, 25 May 95 04:11 PDT
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA13079
(5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Thu, 25 May 1995 04:09:30 -0700
Received: by bootes.cus.cam.ac.uk
(Smail-3.1.29.0 #36) id m0sEaoK-000C0EC; Thu, 25 May 95 12:10 BST
Received: by chiark
id m0sEQuM-0000XRZ
(Debian /\oo/\ Smail3.1.29.1 #29.31); Thu, 25 May 95 01:36 BST
Message-Id: <m0sEQuM-0000XRZ.ijackson@nyx.cs.du.edu>
Date: Thu, 25 May 95 01:36 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: Debian bugs submission address <debian-bugs@pixar.com>
Package: inn
Version: 1.4sec-7
Some background: I run a news server on my system. Newsreading
clients connect to it through the localhost interface, and I want all
local articles to appear with just `user@shorthostname', &c..
However, I also have a dial-on-demand SLIP link, and run a caching
nameserver. I've set up my /etc/hosts to list the short name of the
local host as the primary name for its interfaces (except for
`localhost', of course).
When I try to post an article without an existing Message-ID nnrpd
tries to make one up. It does this by calling GetFQDN (lib/getfqdn.c)
to try to find the local host's FQDN.
Unfortunately, when it runs gethostbyname() on the result of
gethostname() it doesn't get what it considers an FQDN - it doesn't
contain a `.'. It then adds a `.' to the string it has (`chiark'),
giving `chiark.', and looks that up using gethostbyname.
The comment says:
/* Try to force DNS lookup if NIS/whatever gets in the way. */
Well, doing a name->number translation on `chiark.' is bound to do a
DNS lookup. Unfortunately it will fail. Not only that: because my
local caching named is not authoritative for `.', it brings the phone
link up (costing real money) if the modem is turned on, or pauses for
an unreasonably long time if it is turned off.
I'm not sure how this code ever did anything useful, and it is causing
me problems. I have just #if'd it out of getfqdn.c in my version, and
am recompiling now.
BTW, my working source tree, as I uploaded a little while ago,
contains another patch to help in a related area - it recognises the
loopback network address and prevents attempts to turn `localhost'
into an FQDN. Instead the machine's FQDN (as determined by GetFQDN)
is used instead.
Attached below are my diffs to nnrpd.c and getfqdn.c, relative to the
standard INN 1.4sec source tree.
Ian.
--- inn-1.4sec.orig/nnrpd/nnrpd.c Thu Mar 18 21:04:44 1993
+++ inn-1.4sec/nnrpd/nnrpd.c Thu May 25 01:34:51 1995
@@ -244,6 +244,18 @@
register char **pp;
#endif
+ /* If it was the loopback connection, don't do any of the rest. */
+ if (strcmp(inet_ntoa(*ap), LOOPBACK_HOST) == 0) {
+ p = GetFQDN();
+ if (p == NULL)
+ p = GetConfigValue(_CONF_PATHHOST);
+ if (p == NULL)
+ p = "localhost";
+ (void)strncpy(hostname, p, i);
+ hostname[i - 1] = '\0';
+ return TRUE;
+ }
+
/* Get the official hostname, store it away. */
if ((hp = gethostbyaddr((char *)ap, sizeof *ap, AF_INET)) == NULL)
return FALSE;
--- inn-1.4sec.orig/lib/getfqdn.c Thu Mar 18 21:04:35 1993
+++ inn-1.4sec/lib/getfqdn.c Thu May 25 01:08:43 1995
@@ -34,12 +34,14 @@
/* See if DNS (or /etc/hosts) gives us a full domain name. */
if ((hp = gethostbyname(buff)) == NULL)
return NULL;
+#if 0
if (strchr(hp->h_name, '.') == NULL) {
/* Try to force DNS lookup if NIS/whatever gets in the way. */
(void)strncpy(temp, buff, sizeof buff);
(void)strcat(temp, ".");
hp = gethostbyname(temp);
}
+#endif
if (hp != NULL && strchr(hp->h_name, '.') != NULL) {
if (strlen(hp->h_name) < sizeof buff - 1)
return strcpy(buff, hp->h_name);
Message sent:
From: iwj10@thor.cam.ac.uk (Ian Jackson)
To: iwj10@cus.cam.ac.uk (Ian Jackson)
Subject: Bug#910: Acknowledgement (was: INN has bad behaviour wrt DNS &c on occasionally-connected system)
In-Reply-To: <m0sEQuM-0000XRZ.ijackson@nyx.cs.du.edu>
References: <m0sEQuM-0000XRZ.ijackson@nyx.cs.du.edu>
Thank you for the problem report you have sent regarding Debian GNU/Linux.
This is an automatically generated reply, to let you know your message has
been received. It is being forwarded to the developers' mailing list for
their attention; they will reply in due course.
If you wish to submit further information on your problem, please send
it to debian-bugs@pixar.com, but please ensure that the Subject
line of your message starts with "Bug#910" or "Re: Bug#910" so that
we can identify it as relating to the same problem.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.
Ian Jackson
(maintainer, debian-bugs)
Ian Jackson /
iwj10@thor.cam.ac.uk,
with the debian-bugs tracking mechanism