summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_sockbuf.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>1998-11-11 10:04:13 +0000
committertruckman <truckman@FreeBSD.org>1998-11-11 10:04:13 +0000
commitde184682fa22833c7b18a96a136bc031ae786434 (patch)
treeb9b62a0e361f25bc4ed8f9636cce5f2fd2f12423 /sys/kern/uipc_sockbuf.c
parent225b2f25416b4a11b425250105d4acbfc5bd5638 (diff)
downloadFreeBSD-src-de184682fa22833c7b18a96a136bc031ae786434.zip
FreeBSD-src-de184682fa22833c7b18a96a136bc031ae786434.tar.gz
Installed the second patch attached to kern/7899 with some changes suggested
by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
Diffstat (limited to 'sys/kern/uipc_sockbuf.c')
-rw-r--r--sys/kern/uipc_sockbuf.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index 23c7751..6c55ca0 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
- * $Id: uipc_socket2.c,v 1.39 1998/09/05 13:24:39 bde Exp $
+ * $Id: uipc_socket2.c,v 1.40 1998/11/04 20:22:11 fenner Exp $
*/
#include <sys/param.h>
@@ -213,7 +213,7 @@ sonewconn(head, connstatus)
so->so_state = head->so_state | SS_NOFDREF;
so->so_proto = head->so_proto;
so->so_timeo = head->so_timeo;
- so->so_pgid = head->so_pgid;
+ fsetown(fgetown(head->so_sigio), &so->so_sigio);
so->so_uid = head->so_uid;
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
@@ -321,12 +321,8 @@ sowakeup(so, sb)
sb->sb_flags &= ~SB_WAIT;
wakeup((caddr_t)&sb->sb_cc);
}
- if (so->so_state & SS_ASYNC) {
- if (so->so_pgid < 0)
- gsignal(-so->so_pgid, SIGIO);
- else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0)
- psignal(p, SIGIO);
- }
+ if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL)
+ pgsigio(so->so_sigio, SIGIO, 0);
if (sb->sb_flags & SB_UPCALL)
(*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT);
}
@@ -918,7 +914,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
xso->so_qlimit = so->so_qlimit;
xso->so_timeo = so->so_timeo;
xso->so_error = so->so_error;
- xso->so_pgid = so->so_pgid;
+ xso->so_pgid = so->so_sigio ? so->so_sigio->sio_pgid : 0;
xso->so_oobmark = so->so_oobmark;
sbtoxsockbuf(&so->so_snd, &xso->so_snd);
sbtoxsockbuf(&so->so_rcv, &xso->so_rcv);
OpenPOWER on IntegriCloud