From 45c1ea499ee7f1f4309f1f8aa8b78c16642662db Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 16 Feb 2017 21:16:42 +0100 Subject: fusefrontend_reverse: handle .name files in Access() These were currently passed to decryptPath() were it caused a warning. --- internal/fusefrontend_reverse/rfs.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'internal') 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 { -- cgit v1.2.3