diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-28 15:38:49 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-28 15:38:49 +0000 |
commit | 7e79c9c3e3d2d370fb7d7259c255552fb2212eb3 (patch) | |
tree | 0e575c1832ff085517b91472c5891cfc04ab32c8 /pkg/sentry/vfs/options.go | |
parent | b568c1729c72184f8ae8219db7342e42c13458ef (diff) | |
parent | f3ca5ca82abe35d13210f8a8035926170bb87436 (diff) |
Merge release-20200413.0-10-gf3ca5ca (automated)
Diffstat (limited to 'pkg/sentry/vfs/options.go')
-rwxr-xr-x | pkg/sentry/vfs/options.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/options.go b/pkg/sentry/vfs/options.go index 022bac127..53d364c5c 100755 --- a/pkg/sentry/vfs/options.go +++ b/pkg/sentry/vfs/options.go @@ -151,6 +151,24 @@ type SetStatOptions struct { Stat linux.Statx } +// BoundEndpointOptions contains options to VirtualFilesystem.BoundEndpointAt() +// and FilesystemImpl.BoundEndpointAt(). +type BoundEndpointOptions struct { + // Addr is the path of the file whose socket endpoint is being retrieved. + // It is generally irrelevant: most endpoints are stored at a dentry that + // was created through a bind syscall, so the path can be stored on creation. + // However, if the endpoint was created in FilesystemImpl.BoundEndpointAt(), + // then we may not know what the original bind address was. + // + // For example, if connect(2) is called with address "foo" which corresponds + // a remote named socket in goferfs, we need to generate an endpoint wrapping + // that file. In this case, we can use Addr to set the endpoint address to + // "foo". Note that Addr is only a best-effort attempt--we still do not know + // the exact address that was used on the remote fs to bind the socket (it + // may have been "foo", "./foo", etc.). + Addr string +} + // GetxattrOptions contains options to VirtualFilesystem.GetxattrAt(), // FilesystemImpl.GetxattrAt(), FileDescription.Getxattr(), and // FileDescriptionImpl.Getxattr(). |