From f8a67d283f89b5c735a95a5cc480cda517c8faef Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 13:23:39 +1000 Subject: [PATCH] Fixed a mkdir bug on Linux. --- fuseops/convert.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fuseops/convert.go b/fuseops/convert.go index 9e1c6fc..fb30d8e 100644 --- a/fuseops/convert.go +++ b/fuseops/convert.go @@ -140,8 +140,16 @@ func Convert( protocol: protocol, Parent: InodeID(m.Hdr.Nodeid), Name: string(name), - Mode: fuseshim.FileMode(in.Mode), + + // On Linux, vfs_mkdir calls through to the inode with at most + // permissions and sticky bits set (cf. https://goo.gl/WxgQXk), and fuse + // passes that on directly (cf. https://goo.gl/f31aMo). In other words, + // the fact that this is a directory is implicit in the fact that the + // opcode is mkdir. But we want the correct mode to go through, so ensure + // that os.ModeDir is set. + Mode: fuseshim.FileMode(in.Mode) | os.ModeDir, } + io = to co = &to.commonOp