PERFORCE change 45453 for review
John Baldwin
jhb at FreeBSD.org
Fri Jan 16 11:16:38 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=45453
Change 45453 by jhb at 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
More information about the p4-projects
mailing list