aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend/node.go3
-rw-r--r--internal/fusefrontend/node_helpers.go2
2 files changed, 5 insertions, 0 deletions
diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go
index 657a3bc..8370a22 100644
--- a/internal/fusefrontend/node.go
+++ b/internal/fusefrontend/node.go
@@ -354,6 +354,9 @@ func (n *Node) Symlink(ctx context.Context, target, name string, out *fuse.Entry
errno = fs.ToErrno(err)
return
}
+ // Report the plaintext size, not the encrypted blob size
+ st.Size = int64(len(target))
+
inode = n.newChild(ctx, st, out)
return inode, 0
}
diff --git a/internal/fusefrontend/node_helpers.go b/internal/fusefrontend/node_helpers.go
index 6c30523..b2f1d4a 100644
--- a/internal/fusefrontend/node_helpers.go
+++ b/internal/fusefrontend/node_helpers.go
@@ -58,6 +58,8 @@ func (n *Node) readlink(dirfd int, cName string) (out []byte, errno syscall.Errn
}
// translateSize translates the ciphertext size in `out` into plaintext size.
+// Handles regular files & symlinks (and finds out what is what by looking at
+// `out.Mode`).
func (n *Node) translateSize(dirfd int, cName string, out *fuse.Attr) {
if out.IsRegular() {
rn := n.rootNode()