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

2009-08-11 Thread Steve Langasek
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 Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@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.0 +
+++ eglibc-2.10.1/debian/changelog	2009-08-11 20:02:18.0 +
@@ -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.langa...@ubuntu.com  Tue, 11 Aug 2009 19:58:18 +
+
 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.0 +
+++ eglibc-2.10.1/debian/patches/all/submitted-missing-etc-hosts.diff	2009-08-11 20:02:18.0 +
@@ -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.0 +
+++ eglibc-2.10.1/debian/patches/series	2009-08-11 20:02:18.0 +
@@ -144,3 +144,4 @@
 ubuntu/ia64-include.diff
 ubuntu/machine-sparcv2.diff
 ubuntu/retain-fatal-msg.diff
+all/submitted-missing-etc-hosts.diff


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

2009-08-04 Thread Matthias Klose

Package: libc6
Version: 2.10.1-0exp1
Severity: important

E.g. apt-get's call to getaddrinfo() returns with EAI_SYSTEM when /etc/hosts is 
missing and EAI_NONAME if /etc/hosts is empty. This is different from 2.9, where 
EAI_NONAME is returned in both cases, resulting in the regression in apt-get. 
`sudo whoami' prints an additional error message but works as expected otherwise.




--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2009-08-04 Thread Aurelien Jarno
On Tue, Aug 04, 2009 at 07:54:20PM +0200, Matthias Klose wrote:
 Package: libc6
 Version: 2.10.1-0exp1

This version does not even exists in Debian...

-- 
Aurelien Jarno  GPG: 1024D/F1BCDB73
aurel...@aurel32.net http://www.aurel32.net



-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org