Comments (5)
try using the debug functionality to see which call exactly gets EPERM. I suspect you either didn't implement SetAttr or something is wrong with your Access implementation.
from go-fuse.
the debug message as below
2023-01-17 21:11:42.407925 I | rx 6: GETATTR n1 {Fh 0}
2023-01-17 21:11:42.417914 I | tx 6: OK, {tA=1s {M040777 SZ=4096 L=3 0:0 B865536 i0:1 A 1672905996.913452 M 1673853159.412717 C 1673853159.412717}}
2023-01-17 21:11:42.418091 I | rx 8: GETXATTR n1 {sz 4096} ["system.posix_acl_access"] 24b
2023-01-17 21:11:42.418214 I | tx 8: 38=function not implemented
2023-01-17 21:11:42.418276 I | rx 10: LOOKUP n1 ["test.txt"] 9b
2023-01-17 21:11:42.420844 I | tx 10: OK, {n502 g1 tE=1s tA=1s {M0100664 SZ=0 L=1 1000:1000 B065536 i0:502 A 1673689003.279131 M 1673689003.279131 C 1673689003.279131}}
2023-01-17 21:11:42.421099 I | rx 12: GETATTR n502 {Fh 0}
2023-01-17 21:11:42.422654 I | tx 12: OK, {tA=1s {M0100664 SZ=0 L=1 1000:1000 B0*65536 i0:502 A 1673689003.279131 M 1673689003.279131 C 1673689003.279131}}
i am sure our app have been implement SetAttr method,Certain configurations limit functionality?
from go-fuse.
package main
import (
"context"
"flag"
"fmt"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"log"
"syscall"
)
type HelloRoot struct {
fs.Inode
}
func (r *HelloRoot) OnAdd(ctx context.Context) {
ch := r.NewPersistentInode(
ctx, &fs.MemRegularFile{
Data: []byte("file.txt"),
Attr: fuse.Attr{
Mode: 0644,
},
}, fs.StableAttr{Ino: 2})
r.AddChild("file.txt", ch, false)
}
func (r *HelloRoot) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno {
out.Mode = 0755
fmt.Printf(".....lllllll------\n")
return 0
}
func (r *HelloRoot) SetAttr(cancel <-chan struct{}, in *fuse.SetAttrIn, out *fuse.AttrOut) fuse.Status {
out.Mode = 777
fmt.Printf("...asdfasdfasdfasd....\n")
return 0
}
var _ = (fs.NodeGetattrer)((*HelloRoot)(nil))
var _ = (fs.NodeOnAdder)((*HelloRoot)(nil))
func main() {
flag.Parse()
if len(flag.Args()) < 1 {
log.Fatal("Usage:\n hello MOUNTPOINT")
}
opts := &fs.Options{}
opts.Debug = true
server, err := fs.Mount(flag.Arg(0), &HelloRoot{}, opts)
if err != nil {
log.Fatalf("Mount fail: %v\n", err)
}
server.Wait()
}
i use hello app in example,but with implements SetAttr,but SetAttr can not be called, although execute chown command without any error
from go-fuse.
Please compare with the loopback example (see below). I think you are missing root permissions somewhere.
--- 1st terminal ---
$ cd go-fuse/example/loopback
$ go build
$ mkdir a b
$ sudo ./loopback b a
Mounted!
--- 2nd terminal -----
$ sudo -s
# cd go-fuse/example/loopback/b
# touch test.txt
# ls -l
total 0
-rw-r--r--. 1 root root 0 18. Jan 08:15 test.txt
# chown jakob test.txt
# ls -l
total 0
-rw-r--r--. 1 jakob root 0 18. Jan 08:15 test.txt
from go-fuse.
sudo -s
thx for your help,i got this problem fix
from go-fuse.
Related Issues (20)
- panic: XTIMES (80000000) overlaps with INIT_RESERVED (80000000) in v2.4.2 on darwin HOT 1
- Error when build gocryptfs with 2.4.2 release HOT 1
- What's the detail limitations on macOS?
- loopbackfs encountered 'utimensat' error when using `cp` HOT 6
- opcode POLL HOT 8
- panic: LARGEFILE (8000) overlaps with LARGEFILE (8000) HOT 2
- Loopback fs could no be used inside a tree HOT 1
- Should Inode.Forgotten() return true if Inode.changeCounter == 0? HOT 6
- Error message when using `DirectMount: true`: writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE HOT 4
- Concurrent mount/unmount results in hanging HOT 15
- Support for linux FUSE_SETXATTR_EXT HOT 1
- FUSE Passthrough Support
- Support for fuse_custom_io feature HOT 2
- Implementing Loopback FS - memory access error in path() function HOT 3
- Issues when unmounting on linux/ darwin HOT 15
- Changing filesize in Getattr Loopback HOT 2
- conflicting values on mipsel64 HOT 2
- macFUSE + LoopbackFS copying files through Finder not working HOT 7
- darwin: go-fuse/fuse.CAP_RENAME_SWAP has value 1<<25 while VFS_RENAME_SWAP has value 0x00000002
- how to use go-fuse HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fuse.