diff options
author | Jakob Unterwurzacher | 2021-03-07 17:22:29 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-03-07 17:22:29 +0100 |
commit | e2dc52a9657e530820b2d5b49ad7425b529029ce (patch) | |
tree | 75683d1194615dc2774a1b0f99850b798ade2b83 /mount.go | |
parent | eaca820e876bfcdc67323eac6dd43ecc420968f2 (diff) |
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
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 { |