diff options
author | Ridwan Sharif <ridwanmsharif@google.com> | 2020-07-20 16:24:27 -0400 |
---|---|---|
committer | Ridwan Sharif <ridwanmsharif@google.com> | 2020-07-23 17:13:24 -0400 |
commit | 2f78c487f17e12dfee08214311c500073cb03fde (patch) | |
tree | 1dd147155e31a554c75a20c082e53b1248391e05 /pkg | |
parent | 3e0e3b9b11fee58835a0a492d66e72b354459e27 (diff) |
Use mode supplied by the mount options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/BUILD | 1 | ||||
-rw-r--r-- | pkg/sentry/fsimpl/fuse/fusefs.go | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/pkg/sentry/fsimpl/fuse/BUILD b/pkg/sentry/fsimpl/fuse/BUILD index 1fb9c438b..737007748 100644 --- a/pkg/sentry/fsimpl/fuse/BUILD +++ b/pkg/sentry/fsimpl/fuse/BUILD @@ -20,6 +20,5 @@ go_library( "//pkg/sentry/vfs", "//pkg/syserror", "//pkg/usermem", - "@org_golang_x_sys//unix:go_default_library", ], ) diff --git a/pkg/sentry/fsimpl/fuse/fusefs.go b/pkg/sentry/fsimpl/fuse/fusefs.go index 6d40e2d87..f7775fb9b 100644 --- a/pkg/sentry/fsimpl/fuse/fusefs.go +++ b/pkg/sentry/fsimpl/fuse/fusefs.go @@ -1,4 +1,4 @@ -// Copyright 2019 The gVisor Authors. +// Copyright 2020 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -130,7 +130,7 @@ func (fsType FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virt log.Warningf("%s.GetFilesystem: invalid mode: %q", fsType.Name(), modeStr) return nil, nil, syserror.EINVAL } - rootMode = linux.FileMode(mode & 07777) + rootMode = linux.FileMode(mode) } fsopts.rootMode = rootMode @@ -157,8 +157,7 @@ func (fsType FilesystemType) GetFilesystem(ctx context.Context, vfsObj *vfs.Virt // returning. Mount will not block on this dispatched request. // root is the fusefs root directory. - defaultFusefsDirMode := linux.FileMode(0755) - root := fs.newInode(creds, defaultFusefsDirMode) + root := fs.newInode(creds, fsopts.rootMode) return fs.VFSFilesystem(), root.VFSDentry(), nil } |