From: Cristiano Giuffrida Date: Wed, 28 Apr 2010 20:41:23 +0000 (+0000) Subject: Don't panic when out of priv structures. X-Git-Tag: v3.1.7~101 X-Git-Url: http://zhaoyanbai.com/repos/man.named-checkconf.html?a=commitdiff_plain;h=83ef7119f6d880f0eaaf8af2d34199c80a501024;p=minix.git Don't panic when out of priv structures. --- diff --git a/servers/rs/manager.c b/servers/rs/manager.c index e78fb2630..6114e91d9 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -453,10 +453,17 @@ struct rproc *rp; init_privs(rp, &rp->r_priv); } - /* Set and synch the privilege structure for the new service. */ + /* Set and synch the privilege structure for the new service. + * In case the following fails, we can't kill the process as no signal + * manager has been assigned yet. The solution is to directly call + * terminate_service() without sending any signal to the process. + */ if ((s = sys_privctl(child_proc_nr_e, SYS_PRIV_SET_SYS, &rp->r_priv)) != OK || (s = sys_getpriv(&rp->r_priv, child_proc_nr_e)) != OK) { - panic("unable to set privilege structure: %d", s); + printf("unable to set privilege structure: %d\n", s); + rp->r_flags |= RS_EXITING; + terminate_service(rp); + return ENOMEM; } /* Copy the executable image into the child process. If this call