Commit bf11280d authored by Aaron Jacobs's avatar Aaron Jacobs

CreateFileOp

parent 39b29365
...@@ -135,12 +135,23 @@ func Convert( ...@@ -135,12 +135,23 @@ func Convert(
io = to io = to
co = &to.commonOp co = &to.commonOp
case *fuseshim.CreateRequest: case fusekernel.OpCreate:
size := fusekernel.CreateInSize(protocol)
if m.Len() < size {
goto corrupt
}
in := (*fusekernel.CreateIn)(m.Data())
name := m.Bytes()[size:]
i := bytes.IndexByte(name, '\x00')
if i < 0 {
goto corrupt
}
name = name[:i]
to := &CreateFileOp{ to := &CreateFileOp{
bfReq: typed, Parent: InodeID(m.Header().Node),
Parent: InodeID(typed.Header.Node), Name: string(name),
Name: typed.Name, Mode: fuseshim.FileMode(in.Mode),
Mode: typed.Mode,
} }
io = to io = to
co = &to.commonOp co = &to.commonOp
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment