diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-07-25 00:12:40 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-07-25 11:27:25 +0200 |
commit | e5f229974166402f51e4ee0695ffb4d1e09fa174 (patch) | |
tree | 44dc7adc4fd02cb563583afaff6ddaa781821e2f /hugofs/rootmapping_fs.go | |
parent | 87a07282a2f01779e098cde0aaee1bae34dc32e6 (diff) | |
download | hugo-e5f229974166402f51e4ee0695ffb4d1e09fa174.tar.gz hugo-e5f229974166402f51e4ee0695ffb4d1e09fa174.zip |
Block symlink dir traversal for /static
This is in line with how it behaved before, but it was lifted a little for the project mount for Hugo Modules,
but that could create hard-to-detect loops.
Diffstat (limited to 'hugofs/rootmapping_fs.go')
-rw-r--r-- | hugofs/rootmapping_fs.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/hugofs/rootmapping_fs.go b/hugofs/rootmapping_fs.go index a1214a02c..31d78219d 100644 --- a/hugofs/rootmapping_fs.go +++ b/hugofs/rootmapping_fs.go @@ -459,9 +459,5 @@ func (f *rootMappingFile) Readdirnames(count int) ([]string, error) { if err != nil { return nil, err } - dirss := make([]string, len(dirs)) - for i, d := range dirs { - dirss[i] = d.Name() - } - return dirss, nil + return fileInfosToNames(dirs), nil } |