Commit b1aee138 authored by Yongwoo Park's avatar Yongwoo Park Committed by Han-Wen Nienhuys

fuse/nodefs: clear entryOut in ReadDirPlus

fuse.EntryOut can be corrupted if FS implementation does not set all fileds in the Lookup of rawFS
go-mtpfs displays wrong information(ls -l) for directory(size, Nlink, ..)
parent 148d3830
......@@ -83,11 +83,10 @@ func (d *connectorDir) ReadDirPlus(input *fuse.ReadIn, out *fuse.DirEntryList) (
continue
}
code := d.rawFS.Lookup(&input.InHeader, e.Name, entryDest)
if !code.Ok() {
// if something went wrong, clear out the entry.
// Clear entryDest before use it, some fields can be corrupted if does not set all fields in rawFS.Lookup
*entryDest = fuse.EntryOut{}
}
d.rawFS.Lookup(&input.InHeader, e.Name, entryDest)
d.lastOffset = off
}
return fuse.OK
......
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