aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/fs_dir.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go
index 05cea75..7d1e3ef 100644
--- a/internal/fusefrontend/fs_dir.go
+++ b/internal/fusefrontend/fs_dir.go
@@ -291,8 +291,8 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f
if isLong == nametransform.LongNameContent {
cNameLong, err := nametransform.ReadLongName(filepath.Join(cDirAbsPath, cName))
if err != nil {
- tlog.Warn.Printf("Skipping entry %q in dir %q: Could not read .name: %v",
- cName, cDirName, err)
+ tlog.Warn.Printf("OpenDir %q: invalid entry %q: Could not read .name: %v",
+ cDirName, cName, err)
errorCount++
continue
}
@@ -304,12 +304,13 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f
name, err := fs.nameTransform.DecryptName(cName, cachedIV)
if err != nil {
- tlog.Warn.Printf("Skipping entry %q in dir %q: %s",
- cName, cDirName, err)
+ tlog.Warn.Printf("OpenDir %q: invalid entry %q: %v",
+ cDirName, cName, err)
errorCount++
continue
}
-
+ // Override the ciphertext name with the plaintext name but reuse the rest
+ // of the structure
cipherEntries[i].Name = name
plain = append(plain, cipherEntries[i])
}
@@ -317,8 +318,8 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f
if errorCount > 0 && len(plain) == 0 {
// Don't let the user stare on an empty directory. Report that things went
// wrong.
- tlog.Warn.Printf("All %d entries in directory %q were invalid, returning EIO",
- errorCount, cDirName)
+ tlog.Warn.Printf("OpenDir %q: all %d entries were invalid, returning EIO",
+ cDirName, errorCount)
status = fuse.EIO
}