diff options
author | green <green@FreeBSD.org> | 1999-08-04 18:53:50 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 1999-08-04 18:53:50 +0000 |
commit | c03366a55d4ace981b016ae999ae67675c486cdd (patch) | |
tree | 12cd9e195ff9e1b516242767963c6e156b837539 /sys/kern/vfs_syscalls.c | |
parent | 0ab4dad80912358b49a3cee9e433dbd909334d19 (diff) | |
download | FreeBSD-src-c03366a55d4ace981b016ae999ae67675c486cdd.zip FreeBSD-src-c03366a55d4ace981b016ae999ae67675c486cdd.tar.gz |
Fix fd race conditions (during shared fd table usage.) Badfileops is
now used in f_ops in place of NULL, and modifications to the files
are more carefully ordered. f_ops should also be set to &badfileops
upon "close" of a file.
This does not fix other problems mentioned in this PR than the first
one.
PR: 11629
Reviewed by: peter
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 3617bfd..bedf79f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.127 1999/08/03 17:07:04 imp Exp $ + * $Id: vfs_syscalls.c,v 1.128 1999/08/04 04:52:18 imp Exp $ */ /* For 4.3 integer FS ID compatibility */ @@ -995,10 +995,10 @@ open(p, uap) p->p_dupfd = 0; vp = nd.ni_vp; + fp->f_data = (caddr_t)vp; fp->f_flag = flags & FMASK; - fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE); fp->f_ops = &vnops; - fp->f_data = (caddr_t)vp; + fp->f_type = (vp->v_type == VFIFO ? DTYPE_FIFO : DTYPE_VNODE); if (flags & (O_EXLOCK | O_SHLOCK)) { lf.l_whence = SEEK_SET; lf.l_start = 0; |