diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-17 20:29:29 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-17 20:29:29 +0000 |
commit | dfadff7b8de5181e7ceaf528fcd5359fa805fe25 (patch) | |
tree | b4438acbb9f233c62771b3c10167aa481d9836ba /pkg/sentry/fsimpl/gofer | |
parent | bc064d0878290cdab7b14d4d207d56c8902ae182 (diff) | |
parent | e3e1b36896750e9c4d07ecb6eaf1a738b08cd876 (diff) |
Merge release-20200810.0-41-ge3e1b3689 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/gofer')
-rw-r--r-- | pkg/sentry/fsimpl/gofer/filesystem.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go index 610a7ed78..a3903db33 100644 --- a/pkg/sentry/fsimpl/gofer/filesystem.go +++ b/pkg/sentry/fsimpl/gofer/filesystem.go @@ -886,9 +886,6 @@ afterTrailingSymlink: if mustCreate { return nil, syserror.EEXIST } - if !child.isDir() && rp.MustBeDir() { - return nil, syserror.ENOTDIR - } // Open existing child or follow symlink. if child.isSymlink() && rp.ShouldFollowSymlink() { target, err := child.readlink(ctx, rp.Mount()) @@ -901,6 +898,9 @@ afterTrailingSymlink: start = parent goto afterTrailingSymlink } + if rp.MustBeDir() && !child.isDir() { + return nil, syserror.ENOTDIR + } return child.openLocked(ctx, rp, &opts) } |