Bug 11282 - IPv6 support is missing when determining FQDN during ADS join
Summary: IPv6 support is missing when determining FQDN during ADS join
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-20 16:17 UTC by David Holder
Modified: 2015-06-06 20:07 UTC (History)
1 user (show)

See Also:


Attachments
Patch Add IPv6 support for determining FQDN during ADS join (4.03 KB, patch)
2015-05-20 16:17 UTC, David Holder
no flags Details
git-am fix for 4.2.next. (4.26 KB, patch)
2015-05-27 18:42 UTC, Jeremy Allison
slow: review+
Details
git-am fix for 4.1.next. (4.06 KB, patch)
2015-05-27 18:42 UTC, Jeremy Allison
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Holder 2015-05-20 16:17:39 UTC
Created attachment 11072 [details]
Patch Add IPv6 support for determining FQDN during ADS join

The existing code uses gethostbyname() which is obsoleted and should not be used.

It can break ADS joins from IPv6-only member servers.

This patch uses getaddrinfo(). With the AI_CANONNAME flag set, getaddrinfo() returns the canonical name of the host (that is its FQDN) in the first addrinfo struct. It only puts the canonical name in the first addrinfo struct as there should only ever be one FQDN.

The bad news with using getaddrinfo() is that for it to work /etc/hosts must be formatted correctly. It is less forgiving than gethostbyname() and does not return all the aliases. As a result, the FQDN must come before any aliases in /etc/hosts. I have added additional DEBUG messages to catch this.
Comment 1 Jeremy Allison 2015-05-27 18:42:27 UTC
Created attachment 11095 [details]
git-am fix for 4.2.next.
Comment 2 Jeremy Allison 2015-05-27 18:42:45 UTC
Created attachment 11096 [details]
git-am fix for 4.1.next.
Comment 3 Jeremy Allison 2015-05-27 21:29:16 UTC
Re-assigning to Karolin for inclusion in 4.2.next, 4.1.next.
Comment 4 Karolin Seeger 2015-06-01 19:19:16 UTC
(In reply to Jeremy Allison from comment #3)
Pushed to autobuild-v4-[1|2]-test.
Comment 5 Karolin Seeger 2015-06-06 20:07:01 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to both branches.
Closing out bug report.

Thanks!