Fix is_myname_or_ipaddr() to be robust against strange DNS setups.
authorJeremy Allison <jra@samba.org>
Thu, 24 Mar 2011 18:55:38 +0000 (11:55 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 20 Apr 2011 18:44:50 +0000 (20:44 +0200)
commit80078cb6ef2e6976cb5ab25a86157bca22c836a2
treed1e8b17d7fe5f22ea828049e7131d9173bb2be3a
parent2167ac2cd42c9ed5aaae0086dbd27e29d1d77686
Fix is_myname_or_ipaddr() to be robust against strange DNS setups.

If IPv6 DNS names are turned on, but Samba isn't configured to
listen on an IPv6 interface, then is_myname_or_ipaddr() can return
false on a valid DNS name that it should detect is our own. If the
IPv6 addr is returned by preference, then looking at the first addr
only causes is_myname_or_ipaddr() to fail. We need to look at all the
addresses returned by the DNS lookup and check all of them against
our interface list. This is an order N^2 lookup, but there shouldn't
be enough addresses to make this a practical problem.

Jeremy.

Fix bug #8038 - Connecting to a printer can return INVALID_PARAMETER when IPv6
DNS names are turned on.
source3/lib/util_sock.c