summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-10-16 22:48:48 +0000
committerpjd <pjd@FreeBSD.org>2010-10-16 22:48:48 +0000
commit884d1009d2260bf8c4f924b6ae87f35d840f635d (patch)
tree7cfcb94229d2571c983b9a14fcde63022e210456 /sbin
parent6634407233da6cf3787d1c6e2a151d9ea012f942 (diff)
downloadFreeBSD-src-884d1009d2260bf8c4f924b6ae87f35d840f635d.zip
FreeBSD-src-884d1009d2260bf8c4f924b6ae87f35d840f635d.tar.gz
Clear signal mask before executing a hook.
Submitted by: Mikolaj Golub <to.my.trociny@gmail.com> MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r--sbin/hastd/hooks.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sbin/hastd/hooks.c b/sbin/hastd/hooks.c
index 9e12300..2e43357 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);
OpenPOWER on IntegriCloud