fusefrontend_reverse: handle .name files in Access()

These were currently passed to decryptPath() were it caused
a warning.
This commit is contained in:
Jakob Unterwurzacher 2017-02-16 21:16:42 +01:00
parent 55d0523dbe
commit 45c1ea499e
1 changed files with 8 additions and 5 deletions

View File

@ -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 {