jacobsa fuse: add uid and gid in create ops

Add Uid and Gid fields in MkDirOp/MkNodOp/CreateFileOp/CreateSymlinkOp

Signed-off-by: Shuoran Liu <shuoranliu@gmail.com>
This commit is contained in:
Shuoran Liu 2019-05-31 18:16:24 +08:00 committed by awzhgw
parent f72bb5475f
commit 7ee565d148
2 changed files with 16 additions and 0 deletions

View File

@ -140,6 +140,9 @@ func convertInMessage(
// opcode is mkdir. But we want the correct mode to go through, so ensure
// that os.ModeDir is set.
Mode: convertFileMode(in.Mode) | os.ModeDir,
Uid: inMsg.Header().Uid,
Gid: inMsg.Header().Gid,
}
case fusekernel.OpMknod:
@ -161,6 +164,8 @@ func convertInMessage(
Parent: fuseops.InodeID(inMsg.Header().Nodeid),
Name: string(name),
Mode: convertFileMode(in.Mode),
Uid: inMsg.Header().Uid,
Gid: inMsg.Header().Gid,
}
case fusekernel.OpCreate:
@ -182,6 +187,8 @@ func convertInMessage(
Parent: fuseops.InodeID(inMsg.Header().Nodeid),
Name: string(name),
Mode: convertFileMode(in.Mode),
Uid: inMsg.Header().Uid,
Gid: inMsg.Header().Gid,
}
case fusekernel.OpSymlink:

View File

@ -229,6 +229,8 @@ type MkDirOp struct {
// The name of the child to create, and the mode with which to create it.
Name string
Mode os.FileMode
Uid uint32
Gid uint32
// Set by the file system: information about the inode that was created.
//
@ -256,6 +258,8 @@ type MkNodeOp struct {
// The name of the child to create, and the mode with which to create it.
Name string
Mode os.FileMode
Uid uint32
Gid uint32
// Set by the file system: information about the inode that was created.
//
@ -281,6 +285,8 @@ type CreateFileOp struct {
// The name of the child to create, and the mode with which to create it.
Name string
Mode os.FileMode
Uid uint32
Gid uint32
// Set by the file system: information about the inode that was created.
//
@ -308,6 +314,9 @@ type CreateSymlinkOp struct {
// The name of the symlink to create.
Name string
Uid uint32
Gid uint32
// The target of the symlink.
Target string