aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-03-12 12:10:56 -0800
committerchrislu <chris.lu@gmail.com>2022-03-12 12:10:56 -0800
commitb40d252761e92387b281b727d490088ad0bfdab5 (patch)
tree03338a3318e5ae8ad71439088eae51747fed21e5
parent3a6eb8ca5ff6a8f3fbe76933847c0b804c26ba2a (diff)
downloadseaweedfs-b40d252761e92387b281b727d490088ad0bfdab5.tar.xz
seaweedfs-b40d252761e92387b281b727d490088ad0bfdab5.zip
mount: chmod for root
-rw-r--r--weed/mount/weedfs_attr.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go
index 99d6b73bd..55a29542a 100644
--- a/weed/mount/weedfs_attr.go
+++ b/weed/mount/weedfs_attr.go
@@ -79,14 +79,23 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
if mode, ok := input.GetMode(); ok {
// glog.V(4).Infof("setAttr mode %o", mode)
entry.Attributes.FileMode = chmod(entry.Attributes.FileMode, mode)
+ if input.NodeId == 1 {
+ wfs.option.MountMode = os.FileMode(chmod(uint32(wfs.option.MountMode), mode))
+ }
}
if uid, ok := input.GetUID(); ok {
entry.Attributes.Uid = uid
+ if input.NodeId == 1 {
+ wfs.option.MountUid = uid
+ }
}
if gid, ok := input.GetGID(); ok {
entry.Attributes.Gid = gid
+ if input.NodeId == 1 {
+ wfs.option.MountGid = gid
+ }
}
if mtime, ok := input.GetMTime(); ok {