Date: Fri, 16 Jan 2004 11:16:36 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 45453 for review Message-ID: <200401161916.i0GJGaDo014350@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=45453 Change 45453 by jhb@jhb_slimer on 2004/01/16 11:16:12 - Fix psignal() to check P_SYSTEM to see if a process is a system process, not just the pid. - Fix kill() to not send signals to a system process and return EINVAL instead. Is this incorrect given that init gets signals? Affected files ... .. //depot/projects/smpng/sys/kern/kern_sig.c#82 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_sig.c#82 (text+ko) ==== @@ -1392,7 +1392,10 @@ /* kill single process */ if ((p = pfind(uap->pid)) == NULL) return (ESRCH); - error = p_cansignal(td, p, uap->signum); + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) + error = EPERM; + else + error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) psignal(p, uap->signum); PROC_UNLOCK(p); @@ -2144,7 +2147,7 @@ /* * Don't take default actions on system processes. */ - if (p->p_pid <= 1) { + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) { #ifdef DIAGNOSTIC /* * Are you sure you want to ignore SIGSEGV
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401161916.i0GJGaDo014350>