aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2025-08-03 21:22:10 +0200
committerJakob Unterwurzacher2025-08-03 21:25:24 +0200
commitddcc7405e68e6be2cce02dddde3fa6e019c62951 (patch)
tree76a767903a15079f25346036e304665b4fd007f9
parent528834aa89b4645f7a31ec45e7c474026a4f1dce (diff)
fusefronted: report correct directory size in fstat
Fixes https://github.com/rfjakob/gocryptfs/issues/951
-rw-r--r--internal/fusefrontend/file.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index bb9e539..afee158 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -436,7 +436,10 @@ func (f *File) Getattr(ctx context.Context, a *fuse.AttrOut) syscall.Errno {
}
f.rootNode.inoMap.TranslateStat(&st)
a.FromStat(&st)
- a.Size = f.rootNode.contentEnc.CipherSizeToPlainSize(a.Size)
+ if a.IsRegular() {
+ a.Size = f.rootNode.contentEnc.CipherSizeToPlainSize(a.Size)
+ }
+ // TODO: Handle symlink size similar to node.translateSize()
if f.rootNode.args.ForceOwner != nil {
a.Owner = *f.rootNode.args.ForceOwner
}