Skip to content

Commit

Permalink
Encrypt path in statfs() calls
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lxp authored and rfjakob committed May 12, 2016
1 parent 4ad9d4e commit a93bcab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/fusefrontend/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a93bcab

Please sign in to comment.