diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-04-11 16:47:18 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-04-11 16:47:18 +0000 |
commit | 0fd0c4122540b8650b6a674c1deb83dea65d2d53 (patch) | |
tree | e38525edbf31111b213959243c17304c489ed3f3 /sys/kern | |
parent | 4d3d4423f95af73191ecb396dc63068e4c46aadb (diff) |
The pledge flag for file descriptors opened from /dev/fd was always
set for pledged processes. dup(2) uses the flag from the old file
descriptor. Make open /dev/fd consistent to duplicate and inherit
the flag.
OK deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 5c80fc47d4b..64222af3df1 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_descrip.c,v 1.147 2018/04/09 13:59:03 mpi Exp $ */ +/* $OpenBSD: kern_descrip.c,v 1.148 2018/04/11 16:47:17 bluhm Exp $ */ /* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */ /* @@ -1310,8 +1310,6 @@ dupfdopen(struct proc *p, int indx, int mode) fdp->fd_ofiles[indx] = wfp; fdp->fd_ofileflags[indx] = (fdp->fd_ofileflags[indx] & UF_EXCLOSE) | (fdp->fd_ofileflags[dupfd] & ~UF_EXCLOSE); - if (ISSET(p->p_p->ps_flags, PS_PLEDGE)) - fdp->fd_ofileflags[indx] |= UF_PLEDGED; wfp->f_count++; fd_used(fdp, indx); return (0); |