Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net: hosts.go lookupStaticHost is case-sensitive #12806
Name resolution via a hosts file was considered case sensitive in UNIX-like operating systems even though the standardization attempts of the hosts files (rfc952) suggests it must be case insensitive. I am not quite sure what the correct behavior we must bless but the host names in /etc/hosts are conventionally considered case sensitive.
Are there any current examples on Linux where it would be case-sensitive? This was hit because of an upgrade from Go 1.4 to 1.5 (because of the default change from cgo to the go resolver on Linux). If there is indeed conflicting info I think maintaining compatibly on upgrade to 1.5 should be the tie breaker.
The previous change for #12806 modified internal lookup tables and made LookupAddr return forcibly lowercased host names by accident. This change fixes the issue again without any behavioral change for LookupAddr and adds missing test cases for lookupStaticHost and lookupStaticAddr. Updates #12806. Fixes #13359. Change-Id: Ifff4741cd79eb8b320b1b0f8c5e02b3a167c9fa8 Reviewed-on: https://go-review.googlesource.com/17217 Run-TryBot: Mikio Hara <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Brad Fitzpatrick <firstname.lastname@example.org>