diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2002-01-10 01:25:35 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2002-01-10 01:25:35 +0000 |
| commit | 2b87b6d4f4f19b0162a267350883aaad04761cda (patch) | |
| tree | 9dd3e95da774dec0fa27a19c1a7a80fee03d56a4 /sys/kern/kern_sig.c | |
| parent | ced8202c20f01f6cad37c7903cb713442b2709aa (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_sig.c')
| -rw-r--r-- | sys/kern/kern_sig.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c1f5daceb895..49ce1782e8dc 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -97,6 +97,18 @@ SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, &kern_logsigexit, 0, "Log processes quitting on abnormal signals to syslog(3)"); +/* + * Policy -- Can ucred cr1 send SIGIO to process cr2? + * Should use cr_cansignal() once cr_cansignal() allows SIGIO and SIGURG + * in the right situations. + */ +#define CANSIGIO(cr1, cr2) \ + ((cr1)->cr_uid == 0 || \ + (cr1)->cr_ruid == (cr2)->cr_ruid || \ + (cr1)->cr_uid == (cr2)->cr_ruid || \ + (cr1)->cr_ruid == (cr2)->cr_uid || \ + (cr1)->cr_uid == (cr2)->cr_uid) + int sugid_coredump; SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "Enable coredumping set user/group ID processes"); @@ -2064,8 +2076,7 @@ pgsigio(sigio, sig, checkctty) if (sigio->sio_pgid > 0) { PROC_LOCK(sigio->sio_proc); - if (cr_cansignal(sigio->sio_ucred, sigio->sio_proc, sig) - == 0) + if (CANSIGIO(sigio->sio_ucred, sigio->sio_proc->p_ucred)) psignal(sigio->sio_proc, sig); PROC_UNLOCK(sigio->sio_proc); } else if (sigio->sio_pgid < 0) { @@ -2073,7 +2084,7 @@ pgsigio(sigio, sig, checkctty) LIST_FOREACH(p, &sigio->sio_pgrp->pg_members, p_pglist) { PROC_LOCK(p); - if ((cr_cansignal(sigio->sio_ucred, p, sig) == 0) && + if (CANSIGIO(sigio->sio_ucred, p->p_ucred) && (checkctty == 0 || (p->p_flag & P_CONTROLT))) psignal(p, sig); PROC_UNLOCK(p); |
