mirror of
https://github.com/coredns/coredns.git
synced 2025-10-03 11:31:13 +02:00
Clean paths
This commit is contained in:
parent
dcd05032a4
commit
a4bf01e1ee
@ -33,7 +33,7 @@ type Zone struct {
|
|||||||
|
|
||||||
// NewZone returns a new zone.
|
// NewZone returns a new zone.
|
||||||
func NewZone(name, file string) *Zone {
|
func NewZone(name, file string) *Zone {
|
||||||
z := &Zone{origin: dns.Fqdn(name), file: file, Tree: &tree.Tree{}, Expired: new(bool)}
|
z := &Zone{origin: dns.Fqdn(name), file: path.Clean(file), Tree: &tree.Tree{}, Expired: new(bool)}
|
||||||
*z.Expired = false
|
*z.Expired = false
|
||||||
return z
|
return z
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ func (z *Zone) Reload(shutdown chan bool) error {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case event := <-watcher.Events:
|
case event := <-watcher.Events:
|
||||||
if event.Name == z.file {
|
if path.Clean(event.Name) == z.file {
|
||||||
reader, err := os.Open(z.file)
|
reader, err := os.Open(z.file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err)
|
log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user