From e2dc52a9657e530820b2d5b49ad7425b529029ce Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 7 Mar 2021 17:22:29 +0100 Subject: v2api: -sharestorage: disable hard link tracking & add tests Hard link tracking was not correctly disabled since the migration to the go-fuse v2 api. Add a test to ensure it stays off. Fixes https://github.com/rfjakob/gocryptfs/issues/525 --- mount.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'mount.go') diff --git a/mount.go b/mount.go index e4a36d1..571b51b 100644 --- a/mount.go +++ b/mount.go @@ -280,6 +280,7 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f ExcludeFrom: args.excludeFrom, Suid: args.suid, KernelCache: args.kernel_cache, + SharedStorage: args.sharedstorage, } // confFile is nil when "-zerokey" or "-masterkey" was used if confFile != nil { @@ -349,7 +350,11 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server { if args.sharedstorage { // sharedstorage mode sets all cache timeouts to zero so changes to the // backing shared storage show up immediately. - fuseOpts = &fs.Options{} + // Hard links are disabled by using automatically incrementing + // inode numbers provided by go-fuse. + fuseOpts = &fs.Options{ + FirstAutomaticIno: 1000, + } } else { fuseOpts = &fs.Options{ // These options are to be compatible with libfuse defaults, @@ -421,7 +426,8 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server { } else if args.rw { mOpts.Options = append(mOpts.Options, "rw") } - // If both "nosuid" and "suid" were passed, the safer option wins. + // If both "nosuid" & "suid", "nodev" & "dev", etc were passed, the safer + // option wins. if args.nosuid { mOpts.Options = append(mOpts.Options, "nosuid") } else if args.suid { -- cgit v1.2.3