summaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-03-07 17:22:29 +0100
committerJakob Unterwurzacher2021-03-07 17:22:29 +0100
commite2dc52a9657e530820b2d5b49ad7425b529029ce (patch)
tree75683d1194615dc2774a1b0f99850b798ade2b83 /mount.go
parenteaca820e876bfcdc67323eac6dd43ecc420968f2 (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.go10
1 files changed, 8 insertions, 2 deletions
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 {