diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-05-14 14:54:21 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-05-14 14:54:21 -0400 |
commit | d83d0abfbf6f914303c1b33d954aa115accbd999 (patch) | |
tree | 1842018b4c49e4c2a379de239833cb8f6bbda229 /libpod/container_attach_unsupported.go | |
parent | a261b60cc8851c04efd191be6f6e2e4598439822 (diff) | |
download | podman-d83d0abfbf6f914303c1b33d954aa115accbd999.tar.gz podman-d83d0abfbf6f914303c1b33d954aa115accbd999.tar.bz2 podman-d83d0abfbf6f914303c1b33d954aa115accbd999.zip |
Ensure that start() in StartAndAttach() is locked
StartAndAttach() runs start() in a goroutine, which can allow it
to fire after the caller returns - and thus, after the defer to
unlock the container lock has fired.
The start() call _must_ occur while the container is locked, or
else state inconsistencies may occur.
Fixes #3114
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_attach_unsupported.go')
-rw-r--r-- | libpod/container_attach_unsupported.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/container_attach_unsupported.go b/libpod/container_attach_unsupported.go index 068652b29..9e8badeaf 100644 --- a/libpod/container_attach_unsupported.go +++ b/libpod/container_attach_unsupported.go @@ -3,9 +3,11 @@ package libpod import ( + "sync" + "k8s.io/client-go/tools/remotecommand" ) -func (c *Container) attach(streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize, startContainer bool) error { +func (c *Container) attach(streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize, startContainer bool, wg *sync.WaitGroup) error { return ErrNotImplemented } |