Fixed permission errors.
parent
070528d9e4
commit
985bd0ac2b
|
@ -98,9 +98,15 @@ const RootInodeID InodeID = InodeID(bazilfuse.RootID)
|
||||||
type InodeAttributes struct {
|
type InodeAttributes struct {
|
||||||
Size uint64
|
Size uint64
|
||||||
Mode os.FileMode
|
Mode os.FileMode
|
||||||
|
|
||||||
|
// Time information
|
||||||
Atime time.Time
|
Atime time.Time
|
||||||
Mtime time.Time
|
Mtime time.Time
|
||||||
Crtime time.Time
|
Crtime time.Time
|
||||||
|
|
||||||
|
// Owner information
|
||||||
|
Uid uint32
|
||||||
|
Gid uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// A generation number for an inode. Irrelevant for file systems that won't be
|
// A generation number for an inode. Irrelevant for file systems that won't be
|
||||||
|
|
|
@ -22,6 +22,10 @@ import (
|
||||||
type HelloFS struct {
|
type HelloFS struct {
|
||||||
fuseutil.NotImplementedFileSystem
|
fuseutil.NotImplementedFileSystem
|
||||||
Clock timeutil.Clock
|
Clock timeutil.Clock
|
||||||
|
|
||||||
|
// Set by Init.
|
||||||
|
Uid uint32
|
||||||
|
Gid uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ fuse.FileSystem = &HelloFS{}
|
var _ fuse.FileSystem = &HelloFS{}
|
||||||
|
@ -48,8 +52,6 @@ var gInodeInfo = map[fuse.InodeID]inodeInfo{
|
||||||
// root
|
// root
|
||||||
rootInode: inodeInfo{
|
rootInode: inodeInfo{
|
||||||
attributes: fuse.InodeAttributes{
|
attributes: fuse.InodeAttributes{
|
||||||
// TODO(jacobsa): Why do we get premission denied errors when this is
|
|
||||||
// 0500?
|
|
||||||
Mode: 0500 | os.ModeDir,
|
Mode: 0500 | os.ModeDir,
|
||||||
},
|
},
|
||||||
dir: true,
|
dir: true,
|
||||||
|
@ -119,6 +121,8 @@ func findChildInode(
|
||||||
func (fs *HelloFS) patchAttributes(
|
func (fs *HelloFS) patchAttributes(
|
||||||
attr *fuse.InodeAttributes) {
|
attr *fuse.InodeAttributes) {
|
||||||
now := fs.Clock.Now()
|
now := fs.Clock.Now()
|
||||||
|
attr.Uid = fs.Uid
|
||||||
|
attr.Gid = fs.Gid
|
||||||
attr.Atime = now
|
attr.Atime = now
|
||||||
attr.Mtime = now
|
attr.Mtime = now
|
||||||
attr.Crtime = now
|
attr.Crtime = now
|
||||||
|
@ -129,6 +133,8 @@ func (fs *HelloFS) Init(
|
||||||
req *fuse.InitRequest) (
|
req *fuse.InitRequest) (
|
||||||
resp *fuse.InitResponse, err error) {
|
resp *fuse.InitResponse, err error) {
|
||||||
resp = &fuse.InitResponse{}
|
resp = &fuse.InitResponse{}
|
||||||
|
fs.Uid = req.Uid
|
||||||
|
fs.Gid = req.Gid
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue