Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodonato committed Jan 11, 2024
1 parent dedd9c6 commit 4210557
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ jobs:

- name: Test
run: |
go test ./...
go test -v ./...
3 changes: 2 additions & 1 deletion server/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (fs FileSystem) newFile(name string) (*File, error) {
}
if !fs.AllowOutsideSymlinks {
if target, err := filepath.EvalSymlinks(absPath); target != "" {
if err != nil {
if err != nil {
return nil, err
}
path, err := filepath.Abs(target)
Expand All @@ -83,6 +83,7 @@ func (fs FileSystem) newFile(name string) (*File, error) {
if err != nil {
return nil, err
}
fmt.Println("-->", target, path, root, strings.HasPrefix(path, root))
if !strings.HasPrefix(path, root) {
return nil, os.ErrPermission
}
Expand Down
2 changes: 2 additions & 0 deletions testhelpers/tempdir.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testhelpers

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -56,6 +57,7 @@ func (s *TempDirTestSuite) Mkdir(name string) string {
// the new name. Both paths are relative to the tempdir path.
func (s *TempDirTestSuite) Symlink(oldname, newname string) string {
newPath := s.absPath(newname)
fmt.Println(">>", oldname, newname, newPath)
err := os.Symlink(oldname, newPath)
s.Nil(err)
return newPath
Expand Down

0 comments on commit 4210557

Please sign in to comment.