Fix suspending a sudo-run shell in ptrace intercept mode with no pty.
When ptracing a process, we receive the signal-delivery-stop signal before the group-stop signal. If sudo is running the command in the same terminal, we need to wait until the stop signal is actually delivered to the command before we can suspend sudo itself. If we suspend sudo before receiving the group-stop, the command will be restarted with PTRACE_LISTEN too late and will miss the SIGCONT from sudo.
This commit is contained in:
@@ -1100,7 +1100,7 @@ handle_sigchld_pty(struct exec_closure_pty *ec)
|
||||
} else if (WIFSTOPPED(status)) {
|
||||
if (pid != ec->monitor_pid) {
|
||||
if (ISSET(ec->details->flags, CD_USE_PTRACE))
|
||||
exec_ptrace_handled(pid, status, ec->intercept);
|
||||
exec_ptrace_stopped(pid, status, ec->intercept);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user