Skip to content

Commit

Permalink
agent: Don't set ctty fd
Browse files Browse the repository at this point in the history
`Ctty` in `SysProcAttr` should be set to a fd in a child process,
but we were setting it to a fd in the parent process.
This was working by accident, but now a panic is raised by `os/exec`.

See: golang/go#29458
  • Loading branch information
gustavosbarreto committed Aug 28, 2020
1 parent 97488c3 commit 26bbf7c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion agent/sshd/pty.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func openPty(c *exec.Cmd) (*os.File, *os.File, error) {

c.SysProcAttr.Setsid = true
c.SysProcAttr.Setctty = true
c.SysProcAttr.Ctty = int(tty.Fd())

if err := c.Start(); err != nil {
_ = ptmx.Close()
Expand Down

0 comments on commit 26bbf7c

Please sign in to comment.