If the process is already being traced, just resume it and clear flags.

This makes it possible to run sudo in ptrace intercept mode from within
a shell (or other process) that is already being traced by sudo.
This commit is contained in:
Todd C. Miller
2022-05-03 13:34:40 -06:00
parent cc52ab770c
commit e84fdd99fd
4 changed files with 46 additions and 20 deletions

View File

@@ -146,8 +146,8 @@ 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_seize(pid_t child);
bool have_seccomp_action(const char *action);
bool set_exec_filter(void);
int exec_ptrace_seize(pid_t child);
#endif /* SUDO_EXEC_H */