summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_generic.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/sys_generic.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/sys_generic.c')
-rw-r--r--sys/kern/sys_generic.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index bb8f7a3..e16fed7 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
- * $Id: sys_generic.c,v 1.40 1998/08/24 08:39:38 dfr Exp $
+ * $Id: sys_generic.c,v 1.41 1998/09/05 14:30:11 bde Exp $
*/
#include "opt_ktrace.h"
@@ -469,37 +469,6 @@ ioctl(p, uap)
error = (*fp->f_ops->fo_ioctl)(fp, FIOASYNC, (caddr_t)&tmp, p);
break;
- case FIOSETOWN:
- tmp = *(int *)data;
- if (fp->f_type == DTYPE_SOCKET) {
- ((struct socket *)fp->f_data)->so_pgid = tmp;
- error = 0;
- break;
- }
- if (tmp <= 0) {
- tmp = -tmp;
- } else {
- struct proc *p1 = pfind(tmp);
- if (p1 == 0) {
- error = ESRCH;
- break;
- }
- tmp = p1->p_pgrp->pg_id;
- }
- error = (*fp->f_ops->fo_ioctl)
- (fp, (int)TIOCSPGRP, (caddr_t)&tmp, p);
- break;
-
- case FIOGETOWN:
- if (fp->f_type == DTYPE_SOCKET) {
- error = 0;
- *(int *)data = ((struct socket *)fp->f_data)->so_pgid;
- break;
- }
- error = (*fp->f_ops->fo_ioctl)(fp, (int)TIOCGPGRP, data, p);
- *(int *)data = -*(int *)data;
- break;
-
default:
error = (*fp->f_ops->fo_ioctl)(fp, com, data, p);
/*
OpenPOWER on IntegriCloud