From dc008fbbccf69deba55fd7649424bc568f766596 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 27 Aug 2020 16:50:11 -0700 Subject: unix: return ECONNREFUSE if a socket file exists but a socket isn't bound to it PiperOrigin-RevId: 328843560 --- pkg/sentry/fsimpl/gofer/filesystem.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/sentry/fsimpl/gofer/filesystem.go') diff --git a/pkg/sentry/fsimpl/gofer/filesystem.go b/pkg/sentry/fsimpl/gofer/filesystem.go index 4d581fc29..5d0f487db 100644 --- a/pkg/sentry/fsimpl/gofer/filesystem.go +++ b/pkg/sentry/fsimpl/gofer/filesystem.go @@ -1512,7 +1512,9 @@ func (fs *filesystem) BoundEndpointAt(ctx context.Context, rp *vfs.ResolvingPath path: opts.Addr, }, nil } - return d.endpoint, nil + if d.endpoint != nil { + return d.endpoint, nil + } } return nil, syserror.ECONNREFUSED } -- cgit v1.2.3