diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2019-04-02 17:27:30 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-04-02 17:28:36 -0700 |
commit | 1776ab28f0fb934d399361e6012945c70dcd996f (patch) | |
tree | 4c4cdd0f8e9e528c852332b41b3271fb57cdab7a /pkg/sentry/fs/inode_operations.go | |
parent | f9431fb20f24834dd1d5c450631bdfa04fe042f4 (diff) |
Add test that symlinking over a directory returns EEXIST.
Also remove comments in InodeOperations that required that implementation of
some Create* operations ensure that the name does not already exist, since
these checks are all centralized in the Dirent.
PiperOrigin-RevId: 241637335
Change-Id: Id098dc6063ff7c38347af29d1369075ad1e89a58
Diffstat (limited to 'pkg/sentry/fs/inode_operations.go')
-rw-r--r-- | pkg/sentry/fs/inode_operations.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/sentry/fs/inode_operations.go b/pkg/sentry/fs/inode_operations.go index 548f1eb8b..e8b9ab96b 100644 --- a/pkg/sentry/fs/inode_operations.go +++ b/pkg/sentry/fs/inode_operations.go @@ -104,15 +104,12 @@ type InodeOperations interface { CreateLink(ctx context.Context, dir *Inode, oldname string, newname string) error // CreateHardLink creates a hard link under dir between the target - // Inode and name. Implementations must ensure that name does not - // already exist. + // Inode and name. // // The caller must ensure this operation is permitted. CreateHardLink(ctx context.Context, dir *Inode, target *Inode, name string) error // CreateFifo creates a new named pipe under dir at name. - // Implementations must ensure that an Inode at name does not - // already exist. // // The caller must ensure that this operation is permitted. CreateFifo(ctx context.Context, dir *Inode, name string, perm FilePermissions) error @@ -144,7 +141,6 @@ type InodeOperations interface { Rename(ctx context.Context, oldParent *Inode, oldName string, newParent *Inode, newName string, replacement bool) error // Bind binds a new socket under dir at the given name. - // Implementations must ensure that name does not already exist. // // The caller must ensure that this operation is permitted. Bind(ctx context.Context, dir *Inode, name string, data transport.BoundEndpoint, perm FilePermissions) (*Dirent, error) |