diff options
| author | Ian Lance Taylor <iant@golang.org> | 2021-04-26 17:27:58 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2021-04-27 13:50:09 +0000 |
| commit | 7d22c2181b4343b58e40962cefd52af1284b4294 (patch) | |
| tree | d8e975ccc9e6b025930e8ce173654e65774eb824 /src/syscall/exec_libc2.go | |
| parent | 39844971fb92992305babb4b64d50faa7fea40a0 (diff) | |
| download | go-7d22c2181b4343b58e40962cefd52af1284b4294.tar.xz | |
syscall: restore signal mask after setting foreground process group
Fixes #37217
Change-Id: I0151bb77fc4c4552d1b19c31d784943b72f84b80
Reviewed-on: https://go-review.googlesource.com/c/go/+/313653
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/syscall/exec_libc2.go')
| -rw-r--r-- | src/syscall/exec_libc2.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/syscall/exec_libc2.go b/src/syscall/exec_libc2.go index 37df790193..61b1a226eb 100644 --- a/src/syscall/exec_libc2.go +++ b/src/syscall/exec_libc2.go @@ -91,8 +91,6 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr // Fork succeeded, now in child. - runtime_AfterForkInChild() - // Enable tracing if requested. if sys.Ptrace { if err := ptrace(PTRACE_TRACEME, 0, 0, 0); err != nil { @@ -136,6 +134,10 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr } } + // Restore the signal mask. We do this after TIOCSPGRP to avoid + // having the kernel send a SIGTTOU signal to the process group. + runtime_AfterForkInChild() + // Chroot if chroot != nil { _, _, err1 = rawSyscall(abi.FuncPCABI0(libc_chroot_trampoline), uintptr(unsafe.Pointer(chroot)), 0, 0) |
