diff options
author | truckman <truckman@FreeBSD.org> | 1998-11-11 10:04:13 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 1998-11-11 10:04:13 +0000 |
commit | de184682fa22833c7b18a96a136bc031ae786434 (patch) | |
tree | b9b62a0e361f25bc4ed8f9636cce5f2fd2f12423 /sys/kern/sys_socket.c | |
parent | 225b2f25416b4a11b425250105d4acbfc5bd5638 (diff) | |
download | FreeBSD-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/sys_socket.c')
-rw-r--r-- | sys/kern/sys_socket.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 5b65bea..8cf30cd 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 - * $Id: sys_socket.c,v 1.17 1998/03/28 10:33:07 bde Exp $ + * $Id: sys_socket.c,v 1.18 1998/06/07 17:11:40 dfr Exp $ */ #include <sys/param.h> @@ -44,6 +44,7 @@ #include <sys/sockio.h> #include <sys/stat.h> #include <sys/uio.h> +#include <sys/filedesc.h> #include <net/if.h> #include <net/route.h> @@ -114,12 +115,18 @@ soo_ioctl(fp, cmd, data, p) *(int *)data = so->so_rcv.sb_cc; return (0); - case SIOCSPGRP: - so->so_pgid = *(int *)data; + case FIOSETOWN: + return (fsetown(*(int *)data, &so->so_sigio)); + + case FIOGETOWN: + *(int *)data = fgetown(so->so_sigio); return (0); + case SIOCSPGRP: + return (fsetown(-(*(int *)data), &so->so_sigio)); + case SIOCGPGRP: - *(int *)data = so->so_pgid; + *(int *)data = -fgetown(so->so_sigio); return (0); case SIOCATMARK: |