mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
Switch to bufio Reader for exec streams
There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened. Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences. Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container. Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package libpod
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@ -361,7 +362,7 @@ type AttachStreams struct {
|
||||
// ErrorStream will be attached to container's STDERR
|
||||
ErrorStream io.WriteCloser
|
||||
// InputStream will be attached to container's STDIN
|
||||
InputStream io.Reader
|
||||
InputStream *bufio.Reader
|
||||
// AttachOutput is whether to attach to STDOUT
|
||||
// If false, stdout will not be attached
|
||||
AttachOutput bool
|
||||
|
Reference in New Issue
Block a user