diff options
author | Jakob Unterwurzacher | 2019-11-03 20:12:05 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-11-03 20:12:05 +0100 |
commit | 93939961f57e881f2b82293aa8749ea6f1ba6180 (patch) | |
tree | 948733c407064b78d4f891a4464d3f26ffbe2f0a /internal | |
parent | 74b723d765e246f3409d4e538325242eabbc96fe (diff) |
fusefrontend: don't return EIO on directory with corrupt file names
This was meant as a way to inform the user that
something is very wrong, however, users are hitting
the condition on MacOS due to ".DS_Store" files, and
also on NFS due to ".nfsXXX" files.
Drop the whole thing as it seems to cause more pain
than gain.
Fixes https://github.com/rfjakob/gocryptfs/issues/431
Diffstat (limited to 'internal')
-rw-r--r-- | internal/fusefrontend/fs_dir.go | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index 773e389..ad35f93 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -299,7 +299,6 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f } // Decrypted directory entries var plain []fuse.DirEntry - var errorCount int // Filter and decrypt filenames for i := range cipherEntries { cName := cipherEntries[i].Name @@ -326,7 +325,6 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f tlog.Warn.Printf("OpenDir %q: invalid entry %q: Could not read .name: %v", cDirName, cName, err) fs.reportMitigatedCorruption(cName) - errorCount++ continue } cName = cNameLong @@ -339,12 +337,6 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f tlog.Warn.Printf("OpenDir %q: invalid entry %q: %v", cDirName, cName, err) fs.reportMitigatedCorruption(cName) - if runtime.GOOS == "darwin" && cName == dsStoreName { - // MacOS creates lots of these files. Log the warning but don't - // increment errorCount - does not warrant returning EIO. - continue - } - errorCount++ continue } // Override the ciphertext name with the plaintext name but reuse the rest @@ -353,13 +345,5 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f plain = append(plain, cipherEntries[i]) } - if errorCount > 0 && len(plain) == 0 { - // Don't let the user stare on an empty directory. Report that things went - // wrong. - tlog.Warn.Printf("OpenDir %q: all %d entries were invalid, returning EIO", - cDirName, errorCount) - status = fuse.EIO - } - return plain, status } |