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:
parent
c438b740fe
commit
3bbde607ac
2
scan.go
2
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) {
|
||||
|
|
Loading…
Reference in New Issue