Clear signal mask before executing a hook.

Submitted by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2010-10-16 22:48:48 +00:00
parent 23a1bcf8c6
commit c0a124e6ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213938

View File

@ -354,6 +354,7 @@ hook_execv(const char *path, va_list ap)
struct hookproc *hp;
char *args[64];
unsigned int ii;
sigset_t mask;
pid_t pid;
assert(hooks_initialized);
@ -382,6 +383,8 @@ hook_execv(const char *path, va_list ap)
return;
case 0: /* Child. */
descriptors();
PJDLOG_VERIFY(sigemptyset(&mask) == 0);
PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0);
execv(path, args);
pjdlog_errno(LOG_ERR, "Unable to execute %s", path);
exit(EX_SOFTWARE);