summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-22 18:43:09 +0000
committergVisor bot <gvisor-bot@google.com>2020-06-22 18:43:09 +0000
commitccdba983c5db33fc34738c30d8c792b04d7e74b4 (patch)
tree93fab272f53a658e0168d363cf3cf468dec84eea /pkg/sentry/fsimpl/gofer
parent160edcbf44ecd0ddc08804a8ae8bce9aa73627fe (diff)
parent4573e7d863d59d59c6a4f72f396f72b0f6458cb2 (diff)
Merge release-20200608.0-104-g4573e7d86 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/gofer')
-rw-r--r--pkg/sentry/fsimpl/gofer/filesystem.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go
index 5501781ac..f065c4bad 100644
--- a/pkg/sentry/fsimpl/gofer/filesystem.go
+++ b/pkg/sentry/fsimpl/gofer/filesystem.go
@@ -767,15 +767,17 @@ afterTrailingSymlink:
parent.dirMu.Unlock()
return fd, err
}
+ parent.dirMu.Unlock()
if err != nil {
- parent.dirMu.Unlock()
return nil, err
}
- // Open existing child or follow symlink.
- parent.dirMu.Unlock()
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())
if err != nil {