This is the mail archive of the libc-alpha@sources.redhat.com 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 <pekkas@netcore.fi> 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.:
> 
> http://sources.redhat.com/ml/libc-alpha/2000-11/msg00172.html
> http://bugs.gnu.org/cgi-bin/gnatsweb.pl?debug=&database=default&cmd=view+audit-trail&cmd=view&pr=1663
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=60743
> 
> 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  <bcollins@debian.org>

	* 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().
	(gaih_inet): Make use of tryname macro and special case a dotted
	lookup to avoid searching IPv6 domain names on an PF_UNSPEC
	lookup.

-- 
 .----------=======-=-======-=========-----------=====------------=-=-----.
/                   Ben Collins    --    Debian GNU/Linux                  \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'

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]