Bug#389270: [pkg-fetchmail-maint] Bug#389270: additional information

Clemens Buchacher drizzd at aon.at
Mon Dec 4 20:35:39 CET 2006


Hi,

On Thu, Nov 30, 2006 at 11:05:05PM +0100, Matthias Andree wrote:
> Clemens Buchacher schrieb:
> > Not so. I don't know about the original fetchmail code, but the fetchmail
> > Debian package provides its own implementation of getaddrinfo.
> 
> Where and how does it do that?

I was referring to the implementation in libesmtp/getaddrinfo.c, which is
used if the system does not provide a getaddrinfo function. That seemed to
be the only explanation why my change worked. I see now that I was wrong.

Anyways, the real problem seems to be the same as in bug #391698 [1]. The
nameserver configuration (/etc/resolv.conf) is only read during the first
call to getaddrinfo.

For illustration, I have appended a patch which fixes the problem, even if
fetchmail is not restarted in /etc/resolvconf/update-libc.d/fetchmail.
I suppose the current solution is preferable, however.

Regards,
Clemens

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391698

--- fetchmail-6.3.4/driver.c	2006-03-31 14:10:20.000000000 +0200
+++ fetchmail-6.3.4.new/driver.c	2006-12-04 20:19:37.000000000 +0100
@@ -39,6 +39,8 @@
 #include <hesiod.h>
 #endif
 
+#include <resolv.h>
+
 #include <langinfo.h>
 
 #include "kerberos.h"
@@ -1017,6 +1019,9 @@
 		error = getaddrinfo(ctl->server.queryname, NULL, &hints, &res);
 		if (error)
 		{
+		    if (error == EAI_AGAIN)
+			_res.options &= ~RES_INIT;
+
 		    report(stderr,
 			   GT_("couldn't find canonical DNS name of %s (%s)\n"),
 			   ctl->server.pollname, ctl->server.queryname);




More information about the pkg-fetchmail-maint mailing list