public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tpeland at tkukoulu dot fi" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/4980] gethostbyname() etc break for /etc/hosts with both ::1 and 127.0.0.1 localhost entries
Date: Tue, 15 Apr 2008 06:14:00 -0000	[thread overview]
Message-ID: <20080415061334.26818.qmail@sourceware.org> (raw)
In-Reply-To: <20070829170356.4980.pasky@suse.cz>


------- Additional Comments From tpeland at tkukoulu dot fi  2008-04-15 06:13 -------
Created an attachment (id=2693)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2693&action=view)
getaddrinfo fix for 2.6.1/2.7

>Of course it gains something, otherwise it would not have been added.	And
>programs which don't handle multiple addresses are simply broken and must be
>fixed anyway.	Stop defending broken code.

Seems you haven't cheked the code lately. I'll give you real life example
explaining why the mistake of thinking that all hostnames that resolve to ::1
also resolve to 127.0.0.1 is causing big problems to users.

I have ldap hosts defined as:
	localldap.example.org ldap1.example.org ldap2.example.org
As I'm using TLS I must use hostname instead of ip-number.
File /etc/hosts contains following
	::1		localhost localldap.example.org
	127.0.0.1	localhost
As ldap services contain important data it is protected by internal 
firewall. The firewall accepts connection to ldap port from  ldap-master 
and ::1. The reason for using localhost with ldap is that ldap is 
started as early as possible in boot to provide user information. It is 
started before any network other then localhost.

Now as glibc-implementation of getaddrinfo() was changed the first 
connection is done to 127.0.0.1. Firewall blocks this connection and 
after timeout of 15 seconds the connection is tried to ::1. At that 
time it succeeds.

As you can see the program definately can support multiple addresses 
form getaddrinfo() and can hardly be considered buggy.

As OSS camp often says: "talk is cheep, show the code". I have added a fix that
I have verified to work under 2.6.1. The code in question is identical in 2.7.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4980

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2008-04-15  6:14 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29 17:04 [Bug libc/4980] New: " pasky at suse dot cz
2007-08-29 17:32 ` [Bug libc/4980] " drepper at redhat dot com
2007-09-05  0:57 ` pasky at suse dot cz
2007-09-23 16:07 ` drepper at redhat dot com
2007-09-23 20:59 ` pasky at suse dot cz
2007-09-23 22:42 ` drepper at redhat dot com
2007-09-24  0:33 ` pasky at suse dot cz
2007-09-24  3:04 ` drepper at redhat dot com
2007-12-01 20:10 ` hyc at symas dot com
2007-12-14  3:31 ` hyc at symas dot com
2007-12-14  3:53 ` drepper at redhat dot com
2008-04-09 19:13 ` vapier at gentoo dot org
2008-04-09 19:53 ` halcy0n at gentoo dot org
2008-04-10  9:37 ` sylvain dot bertrand at gmail dot com
2008-04-15  6:14 ` tpeland at tkukoulu dot fi [this message]
2008-04-15  6:20 ` tpeland at tkukoulu dot fi
2008-04-15 14:21 ` drepper at redhat dot com
2008-06-18 19:26 ` hyc at symas dot com
2008-07-07  5:06 ` dave dot houston at gmail dot com
2008-07-07  5:57 ` drepper at redhat dot com
2008-07-07 20:30 ` tg at mirbsd dot de
2008-07-07 20:41 ` tonnerre at NetBSD dot org
2008-07-07 20:59 ` carterhawk at gmail dot com
2008-07-07 22:07 ` chris dot f dot ravenscroft at alcatel-lucent dot com
2008-07-07 23:20 ` phelix_dacat at yahoo dot com
2008-07-08  0:43 ` drepper at redhat dot com
2008-07-08  1:31 ` mangmang at thisisnotmyrealemail dot com
2008-07-08  2:02 ` mokomull at gmail dot com
2008-07-08  2:04 ` mokomull at gmail dot com
2008-07-08  3:29 ` drepper at redhat dot com
2008-07-08  4:48 ` junyer at gmail dot com
2008-07-08  5:09 ` drepper at redhat dot com
2008-07-08  6:00 ` robotdevice at gmail dot com
2008-07-08  6:03 ` robotdevice at gmail dot com
2008-07-08  6:29 ` tonnerre at NetBSD dot org
2008-07-08  7:08 ` mantari dot damacy at gmail dot com
2008-07-08  7:41 ` tonnerre at NetBSD dot org
2008-07-08 17:02 ` grfgguvf at gmail dot com
2008-07-08 18:08 ` M8R-ycntwi at sogetthis dot com
2008-07-08 18:28 ` drepper at redhat dot com
2008-07-08 18:51 ` doot at mailinator dot com
2008-07-08 18:54 ` drepper at redhat dot com
2008-07-08 19:11 ` regis dot philbin at hush dot ai
2008-07-08 19:22 ` M8R-1weoa31 at mailinator dot com
2008-07-08 19:23 ` sourceware at trashymail dot com
2008-07-08 19:38 ` pasky at suse dot cz
2008-07-08 22:27 ` grfgguvf at gmail dot com
2009-05-07  1:03 ` zugok8 at gmail dot com
2009-05-07  1:46 ` vapier at gentoo dot org
2009-05-07  5:59 ` ufarkhead at yahoo dot com
2009-05-07  9:10 ` pasky at suse dot cz
2009-05-09 19:44 ` whtt at mailinator dot com
2009-05-15  1:15 ` dedesantana at mailinator dot com
2009-05-15  1:18 ` pasky at suse dot cz
2009-05-15 22:36 ` inuyasha dot exe at gmail dot com
2009-05-16  5:45 ` pasky at suse dot cz
2009-07-25  1:18 ` b501512 at tyldd dot com
2009-08-20 11:48 ` pasky at suse dot cz
2009-08-20 14:11 ` grfgguvf at gmail dot com
2010-01-21 12:57 ` nat dot 4200 at gmail dot com
2010-04-23  2:09 ` samjnaa at gmail dot com
     [not found] <bug-4980-131@http.sourceware.org/bugzilla/>
2012-02-15 20:49 ` aurelien at aurel32 dot net
2012-02-15 21:02 ` aurelien at aurel32 dot net
2012-03-31 21:06 ` slashtrooll at misc dot lka.org.lu
2012-04-01  4:12 ` vapier at gentoo dot org
2014-02-03  1:14 ` alexa.gerancho at hushmail dot com
2015-05-17 17:55 ` netjoker45 at gmail dot com
2015-05-17 17:56 ` netjoker45 at gmail dot com
2015-05-17 17:58 ` netjoker45 at gmail dot com
2015-05-17 17:59 ` netjoker45 at gmail dot com
2015-05-17 18:00 ` netjoker45 at gmail dot com
2015-05-18  2:11 ` vapier at gentoo dot org
2015-05-18  2:12 ` vapier at gentoo dot org
2021-09-15  2:26 ` namboru at jasaseo dot one
2023-10-28 17:09 ` gabravier at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080415061334.26818.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).