This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getaddrinfo with PF_UNSPEC and /etc/hosts

On Thu, Nov 22, 2001 at 10:41:31PM +0200, Pekka Savola wrote:
> On 22 Nov 2001, Ulrich Drepper wrote:
> > Pekka Savola <> writes:
> > 
> > > It was pointed out by Rafal Wojtczuk on Owl development list that telnet
> > > that ships with Red Hat Linux 7.2 does not behave the way one would expect
> > > when resolving names using /etc/hosts.  That is, if you have:
> > > [...]
> > 
> > And you are unable to read the glibc documentation why?  The BUGS file
> > clearly document this.
> Sorry, I didn't notice this.
> For more info, e.g.:
> Debian appears to have a patch that AFAICS hacks around this
> (debian/patches/glibc22-getaddrinfo.dpatch), I haven't tested to see if 
> this is the case.

The test has been tested for quite some time. IMO, it is a security
concern, but I was somewhat blown off when I last brought this up. The
"fix" is a real hack job, but it works, and has been tested since
2001-01-09 (2.2 + CVS), with no ill affects that I know of.

It's attached below for the interested.

2001-01-09  Ben Collins  <>

	* sysdeps/posix/getaddrinfo.c(gethosts): Accept name to lookup,
	so we can explicitly pass it to __gethostbyname2_r(). Also make
	sure we decrement succeeded if that fails.
	(tryname): New macro to do lookup handling, broken out of
	(gaih_inet): Make use of tryname macro and special case a dotted
	lookup to avoid searching IPv6 domain names on an PF_UNSPEC

/                   Ben Collins    --    Debian GNU/Linux                  \
`  --  --  '

Attachment: getaddrinfo.diff
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]