diff options
author | Jakob Unterwurzacher | 2017-09-05 21:47:05 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-09-05 21:47:05 +0200 |
commit | 3a5a783b54a913294658041f22066e0618ee91f3 (patch) | |
tree | 6c619f6529615333d34115d1f1a92e5663f8180f /internal/fusefrontend/fs_dir.go | |
parent | 538cae610cc4f7512cfb7a3b64a47e2fba9ea3c7 (diff) |
macos: don't throw IO errors because of .DS_Store files
MacOS creates lots of these files, and if the directory is otherwise
empty, we would throw an IO error to the unsuspecting user.
With this patch, we log a warning, but otherwise pretend we did not
see it.
Mitigates https://github.com/rfjakob/gocryptfs/issues/140
Diffstat (limited to 'internal/fusefrontend/fs_dir.go')
-rw-r--r-- | internal/fusefrontend/fs_dir.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go index c87cc02..0252c2a 100644 --- a/internal/fusefrontend/fs_dir.go +++ b/internal/fusefrontend/fs_dir.go @@ -7,6 +7,7 @@ import ( "io" "os" "path/filepath" + "runtime" "sync" "syscall" @@ -324,6 +325,11 @@ func (fs *FS) OpenDir(dirName string, context *fuse.Context) ([]fuse.DirEntry, f if err != nil { tlog.Warn.Printf("OpenDir %q: invalid entry %q: %v", cDirName, cName, err) + if runtime.GOOS == "darwin" && cName == ".DS_Store" { + // MacOS creates lots of these files. Log the warning but don't + // increment errorCount - does not warrant returning EIO. + continue + } errorCount++ continue } |