From a92a8621636869003cc7fada3282dabf8e2908d8 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 31 Aug 1997 20:42:33 +0000 Subject: for non-tty TIOCSPGRP/F_SETOWN/FIOSETOWN pgid setting calls, store uid and euid as well, then deliver them using new csignal() interface which ensures that pgid setting process is permitted to signal the pgid process(es). Thanks to newsham@aloha.net for extensive help and discussion. --- sys/net/bpf.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sys/net/bpf.c') diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 7a447e1f6ac..a3e4f17c32a 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.9 1997/03/17 16:29:37 niklas Exp $ */ +/* $OpenBSD: bpf.c,v 1.10 1997/08/31 20:42:29 deraadt Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -522,14 +522,10 @@ static __inline void bpf_wakeup(d) register struct bpf_d *d; { - struct proc *p; - wakeup((caddr_t)d); if (d->bd_async && d->bd_sig) - if (d->bd_pgid > 0) - gsignal (d->bd_pgid, d->bd_sig); - else if ((p = pfind (-d->bd_pgid)) != NULL) - psignal (p, d->bd_sig); + csignal(d->bd_pgid, d->bd_sig, + d->bd_siguid, d->bd_sigeuid); #if BSD >= 199103 selwakeup(&d->bd_sel); @@ -822,6 +818,8 @@ bpfioctl(dev, cmd, addr, flag, p) */ case TIOCSPGRP: /* Process or group to send signals to */ d->bd_pgid = *(int *)addr; + d->bd_siguid = p->p_cred->p_ruid; + d->bd_sigeuid = p->p_ucred->cr_uid; break; case TIOCGPGRP: -- cgit v1.2.3