From 4d28592557ea18a323e6b8b26ddbb8e230212072 Mon Sep 17 00:00:00 2001 From: David Gnedt Date: Thu, 12 May 2016 19:51:13 +0200 Subject: [PATCH] Encrypt path in statfs() calls --- internal/fusefrontend/fs.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index d2465dd4..b7528a13 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -228,6 +228,17 @@ func (fs *FS) Utimens(path string, Atime *time.Time, Mtime *time.Time, context * return fs.FileSystem.Utimens(cPath, Atime, Mtime, context) } +func (fs *FS) StatFs(path string) *fuse.StatfsOut { + if fs.isFiltered(path) { + return nil + } + cPath, err := fs.encryptPath(path) + if err != nil { + return nil + } + return fs.FileSystem.StatFs(cPath) +} + func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status fuse.Status) { cPath, err := fs.encryptPath(path) if err != nil {