Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit09954c4

Browse files
committed
fusefrontend: implement our own Access()
Not having Access() means go-fuse emulates it by looking at Getattr().This works fine most of the time, but breaks down on sshfs, wheresshfs-benchmark.bash shows this:gocryptfs/tests$ ./sshfs-benchmark.bash nuetzlich.networking directory: /tmp/sshfs-benchmark.bash.JQCsshfs mounted: nuetzlich.net:/tmp -> sshfs.mntgocryptfs mounted: sshfs.mnt/sshfs-benchmark.bash.Wrz/gocryptfs.crypt -> gocryptfs.mntsshfs-benchmark.bash: sshfs gocryptfs-on-sshfsgit init 3.98 6.80rsync 7.71 10.84rm -R 4.30rm: descend into write-protected directory 'gocryptfs.mnt/git1'?The go-fuse emulation gets it wrong here because sshfs reportspermissions but does not enforce them.Implement it ourselves properly.
1 parent7d1e48d commit09954c4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎internal/fusefrontend/node.go‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ func (n *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut)
9999
return0
100100
}
101101

102+
func (n*Node)Access(ctx context.Context,modeuint32) syscall.Errno {
103+
dirfd,cName,errno:=n.prepareAtSyscallMyself()
104+
iferrno!=0 {
105+
returnerrno
106+
}
107+
defersyscall.Close(dirfd)
108+
109+
err:=syscallcompat.Faccessat(dirfd,cName,mode)
110+
returnfs.ToErrno(err)
111+
}
112+
102113
// Unlink - FUSE call. Delete a file.
103114
//
104115
// Symlink-safe through use of Unlinkat().

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp