From c0a124e6ce8494560c6fd22d3d14bd3e8d6af472 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sat, 16 Oct 2010 22:48:48 +0000 Subject: [PATCH] Clear signal mask before executing a hook. Submitted by: Mikolaj Golub MFC after: 3 days --- sbin/hastd/hooks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/hastd/hooks.c b/sbin/hastd/hooks.c index 9e12300f46ad..2e43357fdea9 100644 --- a/sbin/hastd/hooks.c +++ b/sbin/hastd/hooks.c @@ -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);