From: semarie Date: Sun, 18 Oct 2015 13:01:40 +0000 (+0000) Subject: regress pledge: test kill() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a9f3958fef28df9534203ef8081f4e774cb50023;p=openbsd regress pledge: test kill() since "inet" has PLEDGE_SELF, and now calling kill() to self is permitted with PLEDGE_SELF, try this with "fattr" --- diff --git a/regress/sys/kern/pledge/generic/main.c b/regress/sys/kern/pledge/generic/main.c index b19a1ac67d5..906fc997fc1 100644 --- a/regress/sys/kern/pledge/generic/main.c +++ b/regress/sys/kern/pledge/generic/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.4 2015/10/18 12:54:25 semarie Exp $ */ +/* $OpenBSD: main.c,v 1.5 2015/10/18 13:01:40 semarie Exp $ */ /* * Copyright (c) 2015 Sebastien Marie * @@ -266,8 +266,8 @@ main(int argc, char *argv[]) /* inet under inet is ok */ start_test(&ret, "inet", NULL, test_inet); - /* kill under inet is forbidden */ - start_test(&ret, "inet", NULL, test_kill); + /* kill under fattr is forbidden (don't have PLEDGE_SELF) */ + start_test(&ret, "fattr", NULL, test_kill); /* kill under proc is allowed */ start_test(&ret, "proc", NULL, test_kill); diff --git a/regress/sys/kern/pledge/generic/tests.out b/regress/sys/kern/pledge/generic/tests.out index 406d697b24d..a04220c6689 100644 --- a/regress/sys/kern/pledge/generic/tests.out +++ b/regress/sys/kern/pledge/generic/tests.out @@ -1,9 +1,9 @@ -# $OpenBSD: tests.out,v 1.5 2015/10/18 12:54:25 semarie Exp $ +# $OpenBSD: tests.out,v 1.6 2015/10/18 13:01:40 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=("inet",NULL) status=0 exit=0 -test(test_kill): pledge=("inet",NULL) status=9 signal=9 pledged_syscall=37 +test(test_kill): pledge=("fattr",NULL) status=9 signal=9 pledged_syscall=37 test(test_kill): pledge=("proc",NULL) status=2 signal=2 pledged_syscall=not_found test(test_allowed_syscalls): pledge=("malloc",NULL) status=0 exit=0 test(test_allowed_syscalls): pledge=("rw",NULL) status=0 exit=0