[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#539950: when /etc/hosts doesn't exist, apt fails to resolve hostnames using libc6 2.10.1



tags 533950 patch
thanks

Hi,

Here's a patch that fixes getaddrinfo() (derived from Aurélien's patch at
http://www.eglibc.org/archives/patches/msg00738.html).  Confirmed to work in
Ubuntu karmic, and uploaded in eglibc 2.10.1-0ubuntu6.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org
diff -Nru eglibc-2.10.1/debian/changelog eglibc-2.10.1/debian/changelog
--- eglibc-2.10.1/debian/changelog	2009-08-11 20:02:06.000000000 +0000
+++ eglibc-2.10.1/debian/changelog	2009-08-11 20:02:18.000000000 +0000
@@ -1,3 +1,11 @@
+eglibc (2.10.1-0ubuntu6) karmic; urgency=low
+
+  * patches/all/submitted-missing-etc-hosts.diff: a missing /etc/hosts should
+    be treated as a simple "not found", not as an internal error.
+    LP: #408901.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Tue, 11 Aug 2009 19:58:18 +0000
+
 eglibc (2.10.1-0ubuntu5) karmic; urgency=low
 
   * Expected testsuite results on powerpc64: Mark test-fenv.out as
diff -Nru eglibc-2.10.1/debian/patches/all/submitted-missing-etc-hosts.diff eglibc-2.10.1/debian/patches/all/submitted-missing-etc-hosts.diff
--- eglibc-2.10.1/debian/patches/all/submitted-missing-etc-hosts.diff	1970-01-01 00:00:00.000000000 +0000
+++ eglibc-2.10.1/debian/patches/all/submitted-missing-etc-hosts.diff	2009-08-11 20:02:18.000000000 +0000
@@ -0,0 +1,20 @@
+When /etc/hosts is missing, return NO_DATA instead of an internal error;
+otherwise getaddrinfo() fails instead of falling back to the next backend
+(DNS).
+
+Index: eglibc-2.10.1/nss/nss_files/files-hosts.c
+===================================================================
+--- eglibc-2.10.1.orig/nss/nss_files/files-hosts.c
++++ eglibc-2.10.1/nss/nss_files/files-hosts.c
+@@ -423,6 +423,11 @@
+       if (! keep_stream)
+ 	internal_endent ();
+     }
++  else
++    {
++      *errnop = errno;
++      *herrnop = NO_DATA;
++    }
+ 
+   __libc_lock_unlock (lock);
+ 
diff -Nru eglibc-2.10.1/debian/patches/series eglibc-2.10.1/debian/patches/series
--- eglibc-2.10.1/debian/patches/series	2009-08-11 20:02:06.000000000 +0000
+++ eglibc-2.10.1/debian/patches/series	2009-08-11 20:02:18.000000000 +0000
@@ -144,3 +144,4 @@
 ubuntu/ia64-include.diff
 ubuntu/machine-sparcv2.diff
 ubuntu/retain-fatal-msg.diff
+all/submitted-missing-etc-hosts.diff

Reply to: