diff options
author | 2018-04-26 08:53:20 +0000 | |
---|---|---|
committer | 2018-04-26 08:53:20 +0000 | |
commit | 5fc00d9e4c357f8407f14c26803a51880c130f23 (patch) | |
tree | 000856d2653218b3c7f0511bf719276e748d666e | |
parent | Add regress for .. being disallowed as it currently is (diff) | |
download | wireguard-openbsd-5fc00d9e4c357f8407f14c26803a51880c130f23.tar.xz wireguard-openbsd-5fc00d9e4c357f8407f14c26803a51880c130f23.zip |
failure for exiting on signal
-rw-r--r-- | regress/sys/kern/pledge/pledgepath/syscalls.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/regress/sys/kern/pledge/pledgepath/syscalls.c b/regress/sys/kern/pledge/pledgepath/syscalls.c index a890724d655..a3366c6da76 100644 --- a/regress/sys/kern/pledge/pledgepath/syscalls.c +++ b/regress/sys/kern/pledge/pledgepath/syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscalls.c,v 1.14 2018/04/26 08:42:42 beck Exp $ */ +/* $OpenBSD: syscalls.c,v 1.15 2018/04/26 08:53:20 beck Exp $ */ /* * Copyright (c) 2017 Bob Beck <beck@openbsd.org> @@ -75,6 +75,10 @@ runcompare(int (*func)(int)) waitpid(pid, &status, 0); if (WIFEXITED(status)) nonppath = WEXITSTATUS(status); + if (WIFSIGNALED(status)) { + printf("[FAIL] nonppath exited with signal %d\n", WTERMSIG(status)); + goto fail; + } pid = fork(); if (pid == 0) { exit(func(1)); @@ -83,12 +87,16 @@ runcompare(int (*func)(int)) waitpid(pid, &status, 0); if (WIFEXITED(status)) ppath = WEXITSTATUS(status); - + if (WIFSIGNALED(status)) { + printf("[FAIL] nonppath exited with signal %d\n", WTERMSIG(status)); + goto fail; + } if (ppath == nonppath) { printf("[SUCCESS] ppath = %d, nonppath = %d\n", ppath, nonppath); return 0; } printf("[FAIL] ppath = %d, nonppath = %d\n", ppath, nonppath); + fail: return 1; } |