summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers_remote.go
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2019-05-29 17:04:14 +0200
committerHarald Hoyer <harald@redhat.com>2019-05-29 17:16:18 +0200
commit90ae7206f3ac989c6bc435c03badadcd25976eef (patch)
tree7742a67098d96d101d5cdcee5fea3931e0b35428 /pkg/adapter/containers_remote.go
parent8649dbdc11bc14feb59794d76ba197771d8a6d51 (diff)
downloadpodman-90ae7206f3ac989c6bc435c03badadcd25976eef.tar.gz
podman-90ae7206f3ac989c6bc435c03badadcd25976eef.tar.bz2
podman-90ae7206f3ac989c6bc435c03badadcd25976eef.zip
Fix the varlink upgraded calls
Although an upgraded call is requested, the server has to send at least one reply (can be an error) and the client has to check the reply, before assuming an upgraded connection. Signed-off-by: Harald Hoyer <harald@redhat.com>
Diffstat (limited to 'pkg/adapter/containers_remote.go')
-rw-r--r--pkg/adapter/containers_remote.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go
index c34495b3d..0c0bce813 100644
--- a/pkg/adapter/containers_remote.go
+++ b/pkg/adapter/containers_remote.go
@@ -583,7 +583,15 @@ func (r *LocalRuntime) attach(ctx context.Context, stdin, stdout *os.File, cid s
}
// TODO add detach keys support
- _, err = iopodman.Attach().Send(r.Conn, varlink.Upgrade, cid, detachKeys, start)
+ reply, err := iopodman.Attach().Send(r.Conn, varlink.Upgrade, cid, detachKeys, start)
+ if err != nil {
+ restoreTerminal(oldTermState)
+ return nil, err
+ }
+
+ // See if the server accepts the upgraded connection or returns an error
+ _, err = reply()
+
if err != nil {
restoreTerminal(oldTermState)
return nil, err