summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/host/wait_test.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-03-26 16:46:15 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-26 16:47:20 -0700
commit137f3614009b0ef931c1d00a083b4ae8e6a39bc9 (patch)
tree0411beb065a44e5a42e2e5d272d13d4aa5a190c0 /pkg/sentry/fs/host/wait_test.go
parentedc3c049eb553fcbf32f4a6b515141a26c5609d4 (diff)
Use host-defined file owner and mode, when possible, for imported fds.
Using the host-defined file owner matches VFS1. It is more correct to use the host-defined mode, since the cached value may become out of date. However, kernfs.Inode.Mode() does not return an error--other filesystems on kernfs are in-memory so retrieving mode should not fail. Therefore, if the host syscall fails, we rely on a cached value instead. Updates #1672. PiperOrigin-RevId: 303220864
Diffstat (limited to 'pkg/sentry/fs/host/wait_test.go')
-rw-r--r--pkg/sentry/fs/host/wait_test.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/sentry/fs/host/wait_test.go b/pkg/sentry/fs/host/wait_test.go
index d49c3a635..ce397a5e3 100644
--- a/pkg/sentry/fs/host/wait_test.go
+++ b/pkg/sentry/fs/host/wait_test.go
@@ -20,7 +20,6 @@ import (
"time"
"gvisor.dev/gvisor/pkg/sentry/contexttest"
- "gvisor.dev/gvisor/pkg/sentry/fs"
"gvisor.dev/gvisor/pkg/waiter"
)
@@ -34,7 +33,7 @@ func TestWait(t *testing.T) {
defer syscall.Close(fds[1])
ctx := contexttest.Context(t)
- file, err := NewFile(ctx, fds[0], fs.RootOwner)
+ file, err := NewFile(ctx, fds[0])
if err != nil {
syscall.Close(fds[0])
t.Fatalf("NewFile failed: %v", err)