Use mode supplied by the mount options

This commit is contained in:
Ridwan Sharif
2020-07-23 17:13:24 -04:00
parent 3e0e3b9b11
commit 2f78c487f1
2 changed files with 3 additions and 5 deletions
-1
View File
@@ -20,6 +20,5 @@ go_library(
"//pkg/sentry/vfs",
"//pkg/syserror",
"//pkg/usermem",
"@org_golang_x_sys//unix:go_default_library",
],
)
+3 -4
View File
@@ -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
}