set mount point to existing permissions

fix https://github.com/chrislusf/seaweedfs/issues/806
This commit is contained in:
Chris Lu
2018-12-28 23:36:13 -08:00
parent a8af1e3f5f
commit 03c7447ad6
3 changed files with 33 additions and 2 deletions

View File

@@ -34,8 +34,10 @@ func (dir *Dir) Attr(context context.Context, attr *fuse.Attr) error {
// https://github.com/bazil/fuse/issues/196
attr.Valid = time.Second
if dir.Path == "/" {
attr.Mode = os.ModeDir | 0777
if dir.Path == dir.wfs.option.FilerMountRootPath {
attr.Uid = dir.wfs.option.MountUid
attr.Gid = dir.wfs.option.MountGid
attr.Mode = dir.wfs.option.MountMode
return nil
}

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"math"
"os"
"sync"
"time"
@@ -26,6 +27,10 @@ type Option struct {
DataCenter string
DirListingLimit int
EntryCacheTtl time.Duration
MountUid uint32
MountGid uint32
MountMode os.FileMode
}
var _ = fs.FS(&WFS{})