mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
We must skip unix sockets, fifos, etc when scanning as these are not filetypes we can handle. Currently we return a "bug" error, which results in the walk being aborted and the rest of the tree being essentially invisible to Syncthing. Instead, just ignore these files and continue onwards. This might well be #9859 as well but I can't confirm.
This commit is contained in:
parent
8bd6bdd397
commit
79ef57d0ea
@ -392,9 +392,13 @@ func (w *walker) handleItem(ctx context.Context, path string, info fs.FileInfo,
|
|||||||
|
|
||||||
case info.IsRegular():
|
case info.IsRegular():
|
||||||
return w.walkRegular(ctx, path, info, toHashChan)
|
return w.walkRegular(ctx, path, info, toHashChan)
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Errorf("bug: file info for %v is neither symlink, dir nor regular", path)
|
default:
|
||||||
|
// A special file, socket, fifo, etc. -- do nothing but return
|
||||||
|
// success so we continue the walk.
|
||||||
|
l.Debugf("Skipping non-regular file %s (%s)", path, info.Mode())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *walker) walkRegular(ctx context.Context, relPath string, info fs.FileInfo, toHashChan chan<- protocol.FileInfo) error {
|
func (w *walker) walkRegular(ctx context.Context, relPath string, info fs.FileInfo, toHashChan chan<- protocol.FileInfo) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user