Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 Jan 2014 17:53:56 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: domain name resolution issues

getaddrinfo fails to parse /etc/hosts entries if they are
whitespace prefixed (not sure if that's legit, but glibc
can parse it)

and only the first match is returned, eg.

	getaddrinfo("localhost", 0, 0, &ai);

only gives one result (127.0.0.1) eventhough /etc/hosts says

	127.0.0.1  localhost
	::1        localhost ip6-localhost ip6-loopback

then if i do a name lookup on the returned address with

	getnameinfo(ai->ai_addr, ai->ai_addrlen, host, sizeof host, serv, sizeof serv, 0);

it seems to do a complete dns query to the nameserver,
i wonder if it might worth to do a local /etc/hosts
search first

(i see now that the test system should run in a sandboxed
environment otherwise such interfaces are not possible to
test)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.