From 3bbde607ac2132f47c307b292594a1af4f619fde Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 7 Dec 2017 17:12:20 +0000 Subject: [PATCH] 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 --- scan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan.go b/scan.go index 82a5da0e..77542caa 100644 --- a/scan.go +++ b/scan.go @@ -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) {