Make file_reader follow symlinks

pull/10548/head
stobin 8 years ago
parent 9e20004ec8
commit f1813ae3a3
  1. 11
      pkg/services/provisioning/dashboards/file_reader.go

@ -145,6 +145,17 @@ func createWalkFn(fr *fileReader, folderId int64) filepath.WalkFunc {
return nil
}
checkFilepath, err := filepath.EvalSymlinks(path)
if path != checkFilepath {
path = checkFilepath
fi, err := os.Lstat(checkFilepath)
if err != nil {
return err
}
fileInfo = fi
}
cachedDashboard, exist := fr.cache.getCache(path)
if exist && cachedDashboard.UpdatedAt == fileInfo.ModTime() {
return nil

Loading…
Cancel
Save