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:
@@ -147,7 +147,7 @@ bool utmp_logout(const char *line, int status);
|
||||
char **sudo_preload_dso(char *envp[], const char *dso_file, int intercept_fd);
|
||||
|
||||
/* exec_ptrace.c */
|
||||
bool exec_ptrace_handled(pid_t pid, int status, void *intercept);
|
||||
bool exec_ptrace_stopped(pid_t pid, int status, void *intercept);
|
||||
bool set_exec_filter(void);
|
||||
int exec_ptrace_seize(pid_t child);
|
||||
|
||||
|
Reference in New Issue
Block a user