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.
This commit is contained in:
Sebastian Lackner 2018-12-26 22:12:55 +01:00 committed by rfjakob
parent 5918884926
commit 1ced0b192e
1 changed files with 4 additions and 1 deletions

View File

@ -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