X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/5b84789fdd5dda5bb489a8f0486f983799b16978..7be182d4906b34f434845222c75a1af1a1644733:/openbsd-compat/port-solaris.c diff --git a/openbsd-compat/port-solaris.c b/openbsd-compat/port-solaris.c index aab77756..ca08a155 100644 --- a/openbsd-compat/port-solaris.c +++ b/openbsd-compat/port-solaris.c @@ -29,6 +29,7 @@ #ifdef HAVE_FCNTL_H # include #endif +#include #include #include @@ -85,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) {