diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-09-23 17:00:33 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-09-23 17:18:35 +0200 |
commit | f9168146978bd970d1f4fb061eff75264af88bb1 (patch) | |
tree | de1c92bd07ef177489c1169570cda0d2123a4823 /hugolib/filesystems | |
parent | cae07ce84b3bd4a33fd18b5109a1a3c3dce2191c (diff) | |
download | hugo-f9168146978bd970d1f4fb061eff75264af88bb1.tar.gz hugo-f9168146978bd970d1f4fb061eff75264af88bb1.zip |
Prevent symbolic links from themes
Diffstat (limited to 'hugolib/filesystems')
-rw-r--r-- | hugolib/filesystems/basefs.go | 1 | ||||
-rw-r--r-- | hugolib/filesystems/basefs_test.go | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/hugolib/filesystems/basefs.go b/hugolib/filesystems/basefs.go index c8d568270..77a68a8ae 100644 --- a/hugolib/filesystems/basefs.go +++ b/hugolib/filesystems/basefs.go @@ -718,6 +718,7 @@ func createThemesOverlayFs(p *paths.Paths) (afero.Fs, []string, error) { } fs, err := createOverlayFs(p.Fs.Source, absPaths) + fs = hugofs.NewNoLstatFs(fs) return fs, absPaths, err diff --git a/hugolib/filesystems/basefs_test.go b/hugolib/filesystems/basefs_test.go index ffa430add..9f4b512fd 100644 --- a/hugolib/filesystems/basefs_test.go +++ b/hugolib/filesystems/basefs_test.go @@ -218,6 +218,12 @@ func TestRealDirs(t *testing.T) { checkFileCount(bfs.Resources.Fs, "", assert, 3) + assert.NotNil(bfs.themeFs) + fi, b, err := bfs.themeFs.(afero.Lstater).LstatIfPossible(filepath.Join("resources", "t1.txt")) + assert.NoError(err) + assert.False(b) + assert.Equal("t1.txt", fi.Name()) + } func TestStaticFs(t *testing.T) { |