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 -1
View File
@@ -311,7 +311,7 @@ func (w *walker) walkAndHashFiles(ctx context.Context, toHashChan chan<- protoco
// ignored path need to be handled as well.
// Prepend an empty string to handle ignoredParent without anything
// appended in the first iteration.
for _, name := range append([]string{""}, strings.Split(rel, string(fs.PathSeparator))...) {
for _, name := range append([]string{""}, fs.PathComponents(rel)...) {
ignoredParent = filepath.Join(ignoredParent, name)
info, err = w.Filesystem.Lstat(ignoredParent)
// An error here would be weird as we've already gotten to this point, but act on it nonetheless