summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-02-16 21:16:42 +0100
committerJakob Unterwurzacher2017-02-16 21:16:42 +0100
commit45c1ea499ee7f1f4309f1f8aa8b78c16642662db (patch)
tree58693f862af838096998e2f220f04468e3c4cb28 /internal
parent55d0523dbe405c52e651c2063e1479726e05c2c0 (diff)
fusefrontend_reverse: handle .name files in Access()
These were currently passed to decryptPath() were it caused a warning.
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend_reverse/rfs.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go
index 4a2cc06..bb3b0e5 100644
--- a/internal/fusefrontend_reverse/rfs.go
+++ b/internal/fusefrontend_reverse/rfs.go
@@ -228,11 +228,14 @@ func (rfs *ReverseFS) GetAttr(relPath string, context *fuse.Context) (*fuse.Attr
// Access - FUSE call
func (rfs *ReverseFS) Access(relPath string, mode uint32, context *fuse.Context) fuse.Status {
- if rfs.isTranslatedConfig(relPath) {
- return fuse.OK
- }
- if rfs.isDirIV(relPath) {
- return fuse.OK
+ if rfs.isTranslatedConfig(relPath) || rfs.isDirIV(relPath) || rfs.isNameFile(relPath) {
+ // Virtual files can always be read and never written
+ var R_OK uint32 = 4
+ if mode == R_OK || mode == 0 {
+ return fuse.OK
+ } else {
+ return fuse.EPERM
+ }
}
absPath, err := rfs.abs(rfs.decryptPath(relPath))
if err != nil {