diff options
author | 2018-06-05 09:29:05 +0000 | |
---|---|---|
committer | 2018-06-05 09:29:05 +0000 | |
commit | f695adb710e886406ee58a1fe647719c07d844d7 (patch) | |
tree | 9f3f4028dd2ea6b7957bb6a1832c28feb0354060 /sys/kern/exec_script.c | |
parent | Switch from lazy FPU switching to semi-eager FPU switching: track whether (diff) | |
download | wireguard-openbsd-f695adb710e886406ee58a1fe647719c07d844d7.tar.xz wireguard-openbsd-f695adb710e886406ee58a1fe647719c07d844d7.zip |
Revert introduction of fdinsert(), a sanitify check triggers when
closing a LARVAL file.
Found the hardway by sthen@.
Diffstat (limited to 'sys/kern/exec_script.c')
-rw-r--r-- | sys/kern/exec_script.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c index 619d1e18b4d..d6ac23ba26f 100644 --- a/sys/kern/exec_script.c +++ b/sys/kern/exec_script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_script.c,v 1.45 2018/06/02 10:27:43 mpi Exp $ */ +/* $OpenBSD: exec_script.c,v 1.46 2018/06/05 09:29:05 mpi Exp $ */ /* $NetBSD: exec_script.c,v 1.13 1996/02/04 02:15:06 christos Exp $ */ /* @@ -170,20 +170,17 @@ check_shell: #endif fdplock(p->p_fd); - error = falloc(p, &fp, &epp->ep_fd); - if (error) { - fdpunlock(p->p_fd); + error = falloc(p, 0, &fp, &epp->ep_fd); + fdpunlock(p->p_fd); + if (error) goto fail; - } epp->ep_flags |= EXEC_HASFD; fp->f_type = DTYPE_VNODE; fp->f_ops = &vnops; fp->f_data = (caddr_t) scriptvp; fp->f_flag = FREAD; - fdinsert(p->p_fd, epp->ep_fd, 0, fp); - fdpunlock(p->p_fd); - FRELE(fp, p); + FILE_SET_MATURE(fp, p); } /* set up the parameters for the recursive check_exec() call */ |