diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-02-06 01:21:46 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-06 01:21:46 +0000 |
commit | 0a9f4c25c0e01804828ec584d55c479c472fcd90 (patch) | |
tree | 097a450d0f2232641f73ec50009abb42bfacfa8c /pkg/sentry/fsimpl | |
parent | f01915a93252ed68960af68d736ed0d48d891b6c (diff) | |
parent | 09afd68326898f783927c65f86f813d815d8c16c (diff) |
Merge release-20210125.0-88-g09afd6832 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl')
-rw-r--r-- | pkg/sentry/fsimpl/kernfs/filesystem.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/kernfs/filesystem.go b/pkg/sentry/fsimpl/kernfs/filesystem.go index a7a553619..d6dd6bc41 100644 --- a/pkg/sentry/fsimpl/kernfs/filesystem.go +++ b/pkg/sentry/fsimpl/kernfs/filesystem.go @@ -668,6 +668,12 @@ func (fs *Filesystem) RenameAt(ctx context.Context, rp *vfs.ResolvingPath, oldPa // Can we create the dst dentry? var dst *Dentry pc := rp.Component() + if pc == "." || pc == ".." { + if noReplace { + return syserror.EEXIST + } + return syserror.EBUSY + } switch err := checkCreateLocked(ctx, rp.Credentials(), pc, dstDir); err { case nil: // Ok, continue with rename as replacement. |