diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-11-07 02:57:28 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-07 02:57:28 +0000 |
commit | 821429a0253b52e5db33791755e68e9cf3bd0786 (patch) | |
tree | 625485ef547bd1099c9421df934f7d69152b0daa /pkg/sentry/fsimpl/overlay | |
parent | 717e417c7ad1ac452c9f93a35bdd57cb95cbeb1a (diff) | |
parent | fe9442d3270d14c095932d917e4e53e706866217 (diff) |
Merge release-20201030.0-48-gfe9442d32 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/overlay')
-rw-r--r-- | pkg/sentry/fsimpl/overlay/filesystem.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/overlay/filesystem.go b/pkg/sentry/fsimpl/overlay/filesystem.go index 30601e76d..bc07d72c0 100644 --- a/pkg/sentry/fsimpl/overlay/filesystem.go +++ b/pkg/sentry/fsimpl/overlay/filesystem.go @@ -477,9 +477,6 @@ func (fs *filesystem) doCreateAt(ctx context.Context, rp *vfs.ResolvingPath, dir if name == "." || name == ".." { return syserror.EEXIST } - if !dir && rp.MustBeDir() { - return syserror.ENOENT - } if parent.vfsd.IsDead() { return syserror.ENOENT } @@ -503,6 +500,10 @@ func (fs *filesystem) doCreateAt(ctx context.Context, rp *vfs.ResolvingPath, dir return syserror.EEXIST } + if !dir && rp.MustBeDir() { + return syserror.ENOENT + } + // Ensure that the parent directory is copied-up so that we can create the // new file in the upper layer. if err := parent.copyUpLocked(ctx); err != nil { |