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
@@ -558,7 +558,7 @@ func (f *folder) scanSubdirsBatchAppendFunc(batch *fileInfoBatch) batchAppendFun
// This is a "virtual" parent directory of encrypted files.
// We don't track it, but check if anything still exists
// within and delete it otherwise.
if fi.IsDirectory() && protocol.IsEncryptedParent(fi.Name) {
if fi.IsDirectory() && protocol.IsEncryptedParent(fs.PathComponents(fi.Name)) {
if names, err := f.mtimefs.DirNames(fi.Name); err == nil && len(names) == 0 {
f.mtimefs.Remove(fi.Name)
}