From e0296dec955fa0cdbacac5beababf84945547253 Mon Sep 17 00:00:00 2001 From: Elliot Speck <11192354+Arcayr@users.noreply.github.com> Date: Thu, 17 Dec 2020 02:55:45 +1100 Subject: [PATCH] Switch using Linux "default_permissions" to an optional parameter. (#94) There's no reason for this to be enforced on the user. For use-cases such as S3-backing, there are no "permissions" of such to base this on. Consequently, everything ends up being owned as root and making it far more difficult to use. It should, however, be optional. --- mount_config.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mount_config.go b/mount_config.go index 2b80237..a93c321 100644 --- a/mount_config.go +++ b/mount_config.go @@ -151,6 +151,11 @@ type MountConfig struct { // OpenDir calls at all (Linux >= 5.1): EnableNoOpendirSupport bool + // Disable FUSE default permissions. + // This is useful for situations where the backing data store (e.g., S3) doesn't + // actually utilise any form of qualifiable UNIX permissions. + DisableDefaultPermissions bool + // OS X only. // // The name of the mounted volume, as displayed in the Finder. If empty, a @@ -179,7 +184,9 @@ func (c *MountConfig) toMap() (opts map[string]string) { // Enable permissions checking in the kernel. See the comments on // InodeAttributes.Mode. - opts["default_permissions"] = "" + if !c.DisableDefaultPermissions { + opts["default_permissions"] = "" + } // HACK(jacobsa): Work around what appears to be a bug in systemd v219, as // shipped in Ubuntu 15.04, where it automatically unmounts any file system