aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorDavid Gnedt2016-05-12 19:51:13 +0200
committerJakob Unterwurzacher2016-05-12 23:24:39 +0200
commita93bcabe9c1dea14bf29b94cbddf62c1bec4d315 (patch)
treead5830a100e04be6e3493d2769f67a4d7608146f /internal
parent4ad9d4e444e4f75fd388078b617c411bfab762c8 (diff)
Encrypt path in statfs() calls
Paths in statfs() calls were not encrypted resulting in an Function not implemented error, when the unencrypted path didn't exist in the underlying (encrypted) filesystem. $ df plain/existingdir df: ‘plain/existingdir’: Function not implemented
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend/fs.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index d2465dd..b7528a1 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 {