From 20d138126f0e4a51012406a7b8695dc82d5a57b1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 27 Apr 1999 01:26:54 +0000 Subject: 1999-04-27 Roland McGrath * hurd/hurdexec.c (_hurd_exec): If SIGKILL present in _hurdsig_traced set, pass EXEC_SIGTRAP flag in exec RPC. --- hurd/hurdexec.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'hurd') diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c index 2a283563b8..18ad9ef38d 100644 --- a/hurd/hurdexec.c +++ b/hurd/hurdexec.c @@ -189,6 +189,8 @@ _hurd_exec (task_t task, file_t file, /* The information is all set up now. Try to exec the file. */ { + int flags; + if (pdp) { /* Request the exec server to deallocate some ports from us if the exec @@ -204,7 +206,15 @@ _hurd_exec (task_t task, file_t file, *pdp++ = dtable[i]; } - err = __file_exec (file, task, 0, + flags = 0; +#ifdef EXEC_SIGTRAP + /* PTRACE_TRACEME sets all bits in _hurdsig_traced, which is propagated + through exec by INIT_TRACEMASK, so this checks if PTRACE_TRACEME has + been called in this process in any of its current or prior lives. */ + if (__sigismember (&_hurdsig_traced, SIGKILL)) + flags |= EXEC_SIGTRAP; +#endif + err = __file_exec (file, task, flags, args, argslen, env, envlen, dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize, ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports, -- cgit 1.4.1