mount2: adjust file mode

This commit is contained in:
chrislu
2022-02-18 00:47:02 -08:00
parent f9d33f70b0
commit e8ce30fdc5
4 changed files with 7 additions and 5 deletions

View File

@@ -66,7 +66,7 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
}
if mode, ok := input.GetMode(); ok {
entry.Attributes.FileMode = uint32(mode)
entry.Attributes.FileMode = mode & 07777
}
if uid, ok := input.GetUID(); ok {
@@ -81,6 +81,10 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
entry.Attributes.Mtime = mtime.Unix()
}
if atime, ok := input.GetATime(); ok {
entry.Attributes.Mtime = atime.Unix()
}
entry.Attributes.Mtime = time.Now().Unix()
out.AttrValid = 1
wfs.setAttrByPbEntry(&out.Attr, input.NodeId, entry)