diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2016-01-09 06:13:45 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2016-01-09 06:13:45 +0000 |
commit | 44561d85212d4e0b531b17346ba496c44ca036d5 (patch) | |
tree | f7b05d4397346b9d84d8d1936ab6e94b3344fdb8 /regress/sys | |
parent | d1da0caeb7347c5be2d0f6f18d6cd3ca77b57802 (diff) |
drop "abort" promise, and make it the default behaviour.
The current code has already setted it by default since 1.74
any pledge failure tries to make a coredump (default rules for coredump still
applies: so setuid binaries don't create them locally).
ok deraadt@
Diffstat (limited to 'regress/sys')
-rw-r--r-- | regress/sys/kern/pledge/Makefile | 3 | ||||
-rw-r--r-- | regress/sys/kern/pledge/generic/tests.out | 14 | ||||
-rw-r--r-- | regress/sys/kern/pledge/sigabrt/sigabrt.c | 4 |
3 files changed, 10 insertions, 11 deletions
diff --git a/regress/sys/kern/pledge/Makefile b/regress/sys/kern/pledge/Makefile index cd2ac4d4a8c..5ebe825459d 100644 --- a/regress/sys/kern/pledge/Makefile +++ b/regress/sys/kern/pledge/Makefile @@ -1,7 +1,6 @@ -# $OpenBSD: Makefile,v 1.1 2015/10/09 06:44:13 semarie Exp $ +# $OpenBSD: Makefile,v 1.2 2016/01/09 06:13:43 semarie Exp $ SUBDIR += sigabrt -SUBDIR += sigkill SUBDIR += generic .include <bsd.subdir.mk> diff --git a/regress/sys/kern/pledge/generic/tests.out b/regress/sys/kern/pledge/generic/tests.out index b70a320ffd2..6118824de9e 100644 --- a/regress/sys/kern/pledge/generic/tests.out +++ b/regress/sys/kern/pledge/generic/tests.out @@ -1,11 +1,11 @@ -# $OpenBSD: tests.out,v 1.11 2015/11/14 07:45:56 semarie Exp $ +# $OpenBSD: tests.out,v 1.12 2016/01/09 06:13:43 semarie Exp $ test(test_nop): pledge=("",NULL) status=0 exit=0 -test(test_inet): pledge=("",NULL) status=9 signal=9 pledged_syscall=97 -test(test_inet): pledge=("abort",NULL) status=134 signal=6 coredump=present pledged_syscall=97 -test(test_inet): pledge=("stdio",NULL) status=9 signal=9 pledged_syscall=97 -test(test_inet): pledge=("inet",NULL) status=9 signal=9 pledged_syscall=6 +test(test_inet): pledge=("",NULL) status=134 signal=6 coredump=present pledged_syscall=97 +test(test_inet): pledge=("abort",NULL) status=5632 exit=22 (errno: "Invalid argument") +test(test_inet): pledge=("stdio",NULL) status=134 signal=6 coredump=present pledged_syscall=97 +test(test_inet): pledge=("inet",NULL) status=134 signal=6 coredump=present pledged_syscall=6 test(test_inet): pledge=("stdio inet",NULL) status=0 exit=0 -test(test_kill): pledge=("fattr",NULL) status=9 signal=9 pledged_syscall=122 +test(test_kill): pledge=("fattr",NULL) status=134 signal=6 coredump=present pledged_syscall=122 test(test_kill): pledge=("stdio",NULL) status=2 signal=2 pledged_syscall=not_found test(test_rpath): pledge=("stdio rpath",NULL) status=0 exit=0 test(test_wpath): pledge=("stdio wpath",NULL) status=0 exit=0 @@ -86,6 +86,6 @@ test(test_stat): pledge=("stdio rpath",{"/usr/share/man",NULL}) stat("/usr/bin/gzip"): realpath=failed(2) errno=2 status=0 exit=0 test(test_mmap): pledge=("stdio rpath prot_exec",{"/dev/zero",NULL}) status=0 exit=0 -test(test_mmap): pledge=("stdio rpath",{"/dev/zero",NULL}) status=9 signal=9 pledged_syscall=197 +test(test_mmap): pledge=("stdio rpath",{"/dev/zero",NULL}) status=134 signal=6 coredump=present pledged_syscall=197 test(test_request_stdio): pledge=skip status=0 exit=0 test(test_request_tty): pledge=skip status=0 exit=0 diff --git a/regress/sys/kern/pledge/sigabrt/sigabrt.c b/regress/sys/kern/pledge/sigabrt/sigabrt.c index ef7dc1db9a7..1cc5d69f3a3 100644 --- a/regress/sys/kern/pledge/sigabrt/sigabrt.c +++ b/regress/sys/kern/pledge/sigabrt/sigabrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sigabrt.c,v 1.1 2015/10/09 06:44:13 semarie Exp $ */ +/* $OpenBSD: sigabrt.c,v 1.2 2016/01/09 06:13:43 semarie Exp $ */ /* * Copyright (c) 2015 Sebastien Marie <semarie@openbsd.org> * @@ -37,7 +37,7 @@ main(int argc, char *argv[]) printf("permitted STDIO\n"); fflush(stdout); - if (pledge("abort", NULL) == -1) + if (pledge("", NULL) == -1) err(EXIT_FAILURE, "pledge"); /* this will triggered pledge_fail() */ |