Skip to content

Commit a93bcab

Browse files
lxprfjakob
authored andcommitted
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
1 parent 4ad9d4e commit a93bcab

File tree

1 file changed

+11
-0
lines changed
  • internal/fusefrontend

1 file changed

+11
-0
lines changed

internal/fusefrontend/fs.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ func (fs *FS) Utimens(path string, Atime *time.Time, Mtime *time.Time, context *
228228
return fs.FileSystem.Utimens(cPath, Atime, Mtime, context)
229229
}
230230

231+
func (fs *FS) StatFs(path string) *fuse.StatfsOut {
232+
if fs.isFiltered(path) {
233+
return nil
234+
}
235+
cPath, err := fs.encryptPath(path)
236+
if err != nil {
237+
return nil
238+
}
239+
return fs.FileSystem.StatFs(cPath)
240+
}
241+
231242
func (fs *FS) Readlink(path string, context *fuse.Context) (out string, status fuse.Status) {
232243
cPath, err := fs.encryptPath(path)
233244
if err != nil {

0 commit comments

Comments
 (0)