relative include: now tested! (#602)

* relative include: now tested!

If you take the effort of creating includePath, actually use it when
opening the file. Now tested (again) with CoreDNS (with a zone file that
includes two others)

Failure to include leads to:

~~~
2017/12/07 16:47:00 plugin/file: /tmp/example.org: dns: failed to include `a/1include1.org' as `/tmp/a/1include1.org': "a/1include1.org" at line: 15:24
~~~

* dont change the error line
This commit is contained in:
Miek Gieben 2017-12-07 17:12:20 +00:00 committed by GitHub
parent c438b740fe
commit 3bbde607ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -303,7 +303,7 @@ func parseZone(r io.Reader, origin, f string, defttl *ttlState, t chan *Token, i
if !filepath.IsAbs(includePath) {
includePath = filepath.Join(filepath.Dir(f), includePath)
}
r1, e1 := os.Open(l.token)
r1, e1 := os.Open(includePath)
if e1 != nil {
msg := fmt.Sprintf("failed to open `%s'", l.token)
if !filepath.IsAbs(l.token) {