Commit a4bf01e1 authored by Miek Gieben's avatar Miek Gieben

Clean paths

parent dcd05032
......@@ -33,7 +33,7 @@ type Zone struct {
// NewZone returns a new 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
return z
}
......@@ -118,7 +118,7 @@ func (z *Zone) Reload(shutdown chan bool) error {
for {
select {
case event := <-watcher.Events:
if event.Name == z.file {
if path.Clean(event.Name) == z.file {
reader, err := os.Open(z.file)
if err != nil {
log.Printf("[ERROR] Failed to open `%s' for `%s': %v", z.file, z.origin, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment