summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2023-05-17 16:47:22 +0200
committerJakob Unterwurzacher2023-05-17 16:47:22 +0200
commita40e9a8622b0d79ba0c18361104c47375ebb89a1 (patch)
tree256bf083259cab4d42debcad00f177b29d8fcd84
parent8d3b992824072a3b487214812655a35fd28ee4dc (diff)
mount: set DirectMount: true
Attempt to directly call mount(2) before trying fusermount. This means we can do without fusermount if running as root. https://github.com/rfjakob/gocryptfs/issues/697
-rw-r--r--README.md5
-rw-r--r--mount.go3
2 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6ffa1ff..c7164c3 100644
--- a/README.md
+++ b/README.md
@@ -195,6 +195,11 @@ RM: 2,367
Changelog
---------
+#### vNEXT, in progress
+* Attempt to directly call mount(2) before trying fusermount. This means we
+ can do without fusermount if running as root or in a root-like namespace
+ ([#697](https://github.com/rfjakob/gocryptfs/issues/697)).
+
#### v2.3.2, 2023-04-29
* Fix incorrect file size reported after hard link creation
([#724](https://github.com/rfjakob/gocryptfs/issues/724))
diff --git a/mount.go b/mount.go
index a229245..d856e49 100644
--- a/mount.go
+++ b/mount.go
@@ -396,6 +396,9 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
// Setting SyncRead disables FUSE_CAP_ASYNC_READ. This makes the kernel
// do everything in-order without parallelism.
SyncRead: args.serialize_reads,
+ // Attempt to directly call mount(2) before trying fusermount. This means we
+ // can do without fusermount if running as root.
+ DirectMount: true,
}
mOpts := &fuseOpts.MountOptions