net: DNS fails to resolve when /etc/resolv.conf contains a single, non-\n-terminated line #6646
1. Edit your /etc/resolv.conf to contain a single, non-\n-terminated line. 2. Try to resolve a DNS entry. Result: No entries are read from /etc/resolv.conf, and DNS lookups fail. Which version are you using? (run 'go version') Reproduces on tip as of: go version devel +f257b02e7ffe Wed Oct 23 10:28:28 2013 -0400 darwin/amd64 Please provide any additional information below. Discovered thanks to DNS failures in the wild; took a while to track down. The problem is that readLine reads no data from single-line non-\n-terminated files. https://golang.org/cl/15960047 fixes the problem. Writing tests for this part of the stdlib would require some refactoring. (Looks like this part of the stdlib is fairly old. E.g. it uses make(T, size)[0:0], which I presume was an idiom before make accepted a capacity. It could probably do with some modernization, refactoring, and tests, but that's out of scope here. It is worth filing a separate issue?)
The text was updated successfully, but these errors were encountered:
adg added a commit that referenced this issue
May 11, 2015
This issue was closed.