aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Lackner2018-12-26 22:12:55 +0100
committerrfjakob2018-12-27 15:16:00 +0100
commit1ced0b192e6abcb047af0b9f11dfaf63052598c4 (patch)
treecb097a21ebc4af17c74cea1b4a35fcd91108741d
parent5918884926bf7a4e77b922a2ce6f89e744935cb9 (diff)
fusefrontend: Don't treat Fchownat error as failure in Mkdir.
The directory was already created, so return success even if Fchownat fails. The same error handling is already used if fs.args.PlaintextNames is false.
-rw-r--r--internal/fusefrontend/fs_dir.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go
index caf05e7..963a551 100644
--- a/internal/fusefrontend/fs_dir.go
+++ b/internal/fusefrontend/fs_dir.go
@@ -61,6 +61,9 @@ func (fs *FS) Mkdir(newPath string, mode uint32, context *fuse.Context) (code fu
defer syscall.Close(dirfd)
if fs.args.PlaintextNames {
err = syscallcompat.Mkdirat(dirfd, cName, mode)
+ if err != nil {
+ return fuse.ToStatus(err)
+ }
// Set owner
if fs.args.PreserveOwner {
err = syscallcompat.Fchownat(dirfd, cName, int(context.Owner.Uid),
@@ -69,7 +72,7 @@ func (fs *FS) Mkdir(newPath string, mode uint32, context *fuse.Context) (code fu
tlog.Warn.Printf("Mkdir: Fchownat failed: %v", err)
}
}
- return fuse.ToStatus(err)
+ return fuse.OK
}
// We need write and execute permissions to create gocryptfs.diriv