svn commit: r213938 - head/sbin/hastd

Pawel Jakub Dawidek pjd at FreeBSD.org
Sat Oct 16 22:48:49 UTC 2010


Author: pjd
Date: Sat Oct 16 22:48:48 2010
New Revision: 213938
URL: http://svn.freebsd.org/changeset/base/213938

Log:
  Clear signal mask before executing a hook.
  
  Submitted by:	Mikolaj Golub <to.my.trociny at gmail.com>
  MFC after:	3 days

Modified:
  head/sbin/hastd/hooks.c

Modified: head/sbin/hastd/hooks.c
==============================================================================
--- head/sbin/hastd/hooks.c	Sat Oct 16 20:43:05 2010	(r213937)
+++ head/sbin/hastd/hooks.c	Sat Oct 16 22:48:48 2010	(r213938)
@@ -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);


More information about the svn-src-head mailing list