lib: Prevent using protocol method with native path (fixes #7557) (#7563)

This commit is contained in:
Simon Frei
2021-04-11 15:29:43 +02:00
committed by GitHub
parent ec0a66c75b
commit 1a00ea7c6e
8 changed files with 20 additions and 29 deletions
+1 -2
View File
@@ -9,7 +9,6 @@ package osutil
import (
"fmt"
"path/filepath"
"strings"
"github.com/syncthing/syncthing/lib/fs"
)
@@ -47,7 +46,7 @@ func TraversesSymlink(filesystem fs.Filesystem, name string) error {
}
var path string
for _, part := range strings.Split(name, string(fs.PathSeparator)) {
for _, part := range fs.PathComponents(name) {
path = filepath.Join(path, part)
info, err := filesystem.Lstat(path)
if err != nil {