From 8852e1d441842924caf77ee4d4300ff65ba2e780 Mon Sep 17 00:00:00 2001 From: dtucker Date: Tue, 31 Oct 2006 23:28:49 +0000 Subject: [PATCH] - (dtucker) [openbsd-compat/port-solaris.c] Bug #1255: Make only hwerr events fatal in Solaris process contract support and tell it to signal only processes in the same process group when something happens. Based on information from andrew.benham at thus.net and similar to a patch from Chad Mynhier. ok djm@ --- ChangeLog | 7 +++++++ openbsd-compat/port-solaris.c | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10cffa06..ee5db58d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +20061101 + - (dtucker) [openbsd-compat/port-solaris.c] Bug #1255: Make only hwerr + events fatal in Solaris process contract support and tell it to signal + only processes in the same process group when something happens. + Based on information from andrew.benham at thus.net and similar to + a patch from Chad Mynhier. ok djm@ + 20061027 - (djm) [auth.c] gc some dead code diff --git a/openbsd-compat/port-solaris.c b/openbsd-compat/port-solaris.c index 8c773bd0..ca08a155 100644 --- a/openbsd-compat/port-solaris.c +++ b/openbsd-compat/port-solaris.c @@ -86,18 +86,27 @@ solaris_contract_pre_fork(void) debug2("%s: setting up process contract template on fd %d", __func__, tmpl_fd); - /* We have to set certain attributes before activating the template */ - if (ct_pr_tmpl_set_fatal(tmpl_fd, - CT_PR_EV_HWERR|CT_PR_EV_SIGNAL|CT_PR_EV_CORE) != 0) { + /* First we set the template parameters and event sets. */ + if (ct_pr_tmpl_set_param(tmpl_fd, CT_PR_PGRPONLY) != 0) { + error("%s: Error setting process contract parameter set " + "(pgrponly): %s", __func__, strerror(errno)); + goto fail; + } + if (ct_pr_tmpl_set_fatal(tmpl_fd, CT_PR_EV_HWERR) != 0) { error("%s: Error setting process contract template " "fatal events: %s", __func__, strerror(errno)); goto fail; } - if (ct_tmpl_set_critical(tmpl_fd, CT_PR_EV_HWERR) != 0) { + if (ct_tmpl_set_critical(tmpl_fd, 0) != 0) { error("%s: Error setting process contract template " "critical events: %s", __func__, strerror(errno)); goto fail; } + if (ct_tmpl_set_informative(tmpl_fd, CT_PR_EV_HWERR) != 0) { + error("%s: Error setting process contract template " + "informative events: %s", __func__, strerror(errno)); + goto fail; + } /* Now make this the active template for this process. */ if (ct_tmpl_activate(tmpl_fd) != 0) { -- 2.45.1