Merge pull request #10548 from StevenTobin/follow_symlinks

Make file_reader follow symlinks
pull/10558/head
Carl Bergquist 7 years ago committed by GitHub
commit d6667c4fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      pkg/services/provisioning/dashboards/file_reader.go

@ -151,6 +151,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