summaryrefslogtreecommitdiff
path: root/frontend/dir.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-05 20:11:20 +0200
committerJakob Unterwurzacher2015-09-05 20:11:20 +0200
commit7e564f928fef80b0485210603a8aa58b14ca5109 (patch)
treee011e362d47ae35bf55cc7709a8b47017ec51cca /frontend/dir.go
parent199d3fd79ff03222cf7498418b40e1263f8aa104 (diff)
Fix size reporting
Diffstat (limited to 'frontend/dir.go')
-rw-r--r--frontend/dir.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/frontend/dir.go b/frontend/dir.go
index 46be0db..ee5c474 100644
--- a/frontend/dir.go
+++ b/frontend/dir.go
@@ -11,6 +11,7 @@ import (
type Dir struct {
*cluefs.Dir
+
crfs *cryptfs.CryptFS
}
@@ -39,18 +40,19 @@ func (d *Dir) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenRe
func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (fusefs.Node, error) {
fmt.Printf("Lookup %s\n", req.Name)
req.Name = d.crfs.EncryptPath(req.Name)
- n, err := d.Dir.Lookup(ctx, req, resp)
+ node, err := d.Dir.Lookup(ctx, req, resp)
if err != nil {
return nil, err
}
- clueDir, ok := n.(*cluefs.Dir)
+ clueDir, ok := node.(*cluefs.Dir)
if ok {
return &Dir {
Dir: clueDir,
crfs: d.crfs,
}, nil
} else {
- clueFile := n.(*cluefs.File)
+ resp.Attr.Size = d.crfs.PlainSize(resp.Attr.Size)
+ clueFile := node.(*cluefs.File)
return &File {
File: clueFile,
crfs: d.crfs,