diff options
author | Jakob Unterwurzacher | 2024-11-11 22:27:42 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2024-11-11 22:33:07 +0100 |
commit | 86891054ef2a5d1b0b59c7c140aae284e7c5bd87 (patch) | |
tree | 7e863db4486656fd18ed5a1144e0669fb085bf58 /mount.go | |
parent | 12c0f3a0bdd11444b8bf880af7c63ea7850391f2 (diff) |
Report inode number for the root node
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.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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{ |