aboutsummaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2024-11-11 22:27:42 +0100
committerJakob Unterwurzacher2024-11-11 22:33:07 +0100
commit86891054ef2a5d1b0b59c7c140aae284e7c5bd87 (patch)
tree7e863db4486656fd18ed5a1144e0669fb085bf58 /mount.go
parent12c0f3a0bdd11444b8bf880af7c63ea7850391f2 (diff)
Report inode number for the root nodeHEADmaster
Now that https://github.com/hanwen/go-fuse/issues/399 has landed we can report an inode number for the root node. Fixes https://github.com/rfjakob/gocryptfs/issues/580
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/mount.go b/mount.go
index 61079a9..0eaa3dd 100644
--- a/mount.go
+++ b/mount.go
@@ -351,6 +351,10 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f
return rootNode, func() { cCore.Wipe() }
}
+type RootInoer interface {
+ RootIno() uint64
+}
+
// initGoFuse calls into go-fuse to mount `rootNode` on `args.mountpoint`.
// The mountpoint is ready to use when the functions returns.
// On error, it calls os.Exit and does not return.
@@ -375,6 +379,9 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
}
}
fuseOpts.NullPermissions = true
+ // The inode number for the root node must be manually set on mount
+ // https://github.com/hanwen/go-fuse/issues/399
+ fuseOpts.RootStableAttr = &fs.StableAttr{Ino: rootNode.(RootInoer).RootIno()}
// Enable go-fuse warnings
fuseOpts.Logger = log.New(os.Stderr, "go-fuse: ", log.Lmicroseconds)
fuseOpts.MountOptions = fuse.MountOptions{