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 /regress/sys | |
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 'regress/sys')
-rw-r--r-- | regress/sys/kern/pledge/filedescriptor/Makefile | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/regress/sys/kern/pledge/filedescriptor/Makefile b/regress/sys/kern/pledge/filedescriptor/Makefile index 638b96e8be0..2baf7a795ef 100644 --- a/regress/sys/kern/pledge/filedescriptor/Makefile +++ b/regress/sys/kern/pledge/filedescriptor/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.1 2018/04/10 23:00:53 bluhm Exp $ +# $OpenBSD: Makefile,v 1.2 2018/04/11 16:47:17 bluhm Exp $ # Copyright (c) 2018 Alexander Bluhm <bluhm@openbsd.org> # @@ -14,6 +14,10 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# Check that a file descriptor's plegde flag is correctly propagated. +# The test covers the system calls dup, dup2, dup3, open /dev/fd, and +# file descriptor passing. The fstat(1) output is analysed. + PROGS = dup dup2 dup3 dev pass WARNINGS = yes CLEANFILES = *.fstat @@ -74,7 +78,7 @@ run-regress-dup3: dup3.fstat run-regress-dev: dev.fstat # file descriptor 5 has been open(2)ed from pre-pledge /dev/fd/3 - grep ' 5 /.* rp ' dev.fstat + grep ' 5 /.* r ' dev.fstat # file descriptor 6 has been open(2)ed from post-pledge /dev/fd/4 grep ' 6 /.* rp ' dev.fstat |