Set default_permissions when mounting.

This re-fixes MemFSTest.Mkdir_PermissionDenied on Linux after the recent
shakeup when changing the interface of Mount.
geesefs-0-30-9
Aaron Jacobs 2015-03-17 16:07:09 +11:00
commit 255dbdc3a0
2 changed files with 10 additions and 3 deletions

View File

@ -262,9 +262,10 @@ type InodeAttributes struct {
// The mode of the inode. This is exposed to the user in e.g. the result of
// fstat(2).
//
// The permissions bits of the mode are not necessarily respected by the FUSE
// kernel layer unless the file system is mounted with the
// 'default_permissions' option (cf. http://goo.gl/1LxOop).
// Note that in contrast to the defaults for FUSE, this package mounts file
// systems in a manner such that the kernel checks inode permissions in the
// standard posix way. This is implemented by setting the default_permissions
// mount option (cf. http://goo.gl/1LxOop and http://goo.gl/1pTjuk).
//
// For example, in the case of mkdir:
//

View File

@ -121,6 +121,12 @@ type MountConfig struct {
// Convert to mount options to be passed to package bazilfuse.
func (c *MountConfig) bazilfuseOptions() (opts []bazilfuse.MountOption) {
opts = []bazilfuse.MountOption{
// Enable permissions checking in the kernel. See the comments on
// InodeAttributes.Mode.
bazilfuse.SetOption("default_permissions", ""),
}
return
}