Skip to content

Commit

Permalink
virtcontainers: Set Ctty to 0 instead of int(f.FD())
Browse files Browse the repository at this point in the history
The https://go-review.googlesource.com/c/go/+/231638/ commit on Golang
introduced a failure on Kata Containers when the runtime is built with
golang 15.2+.

Fixes: kata-containers#2982

Signed-off-by: Fabiano Fidêncio <[email protected]>
  • Loading branch information
fidencio committed Nov 18, 2020
1 parent 738409d commit 977f682
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virtcontainers/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ func startShim(args []string, params ShimParams) (int, error) {
cmd.SysProcAttr.Setsid = true
// Set Controlling terminal to Ctty
cmd.SysProcAttr.Setctty = true
cmd.SysProcAttr.Ctty = int(f.Fd())
// FD 0 is attached to the controlling terminal unless Noctty is set to true.
cmd.SysProcAttr.Ctty = 0
}
defer func() {
if f != nil {
Expand Down

0 comments on commit 977f682

Please sign in to comment.