summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2018-07-27 01:41:40 +0000
committerBob Beck <beck@cvs.openbsd.org>2018-07-27 01:41:40 +0000
commitb0c8bb8fff039d6c8d2745f1657be8d65ca9de31 (patch)
tree271fca20a2447d85906f8b0f3f2399473a206ff8
parentc987d65d3c3ad281977056d8f48bbaf300c00e9e (diff)
add regress for unveil of "." now that I fixed this
-rw-r--r--regress/sys/kern/unveil/syscalls.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/regress/sys/kern/unveil/syscalls.c b/regress/sys/kern/unveil/syscalls.c
index e3a5518ef1a..8fc5999fb1d 100644
--- a/regress/sys/kern/unveil/syscalls.c
+++ b/regress/sys/kern/unveil/syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscalls.c,v 1.12 2018/07/27 01:38:02 beck Exp $ */
+/* $OpenBSD: syscalls.c,v 1.13 2018/07/27 01:41:39 beck Exp $ */
/*
* Copyright (c) 2017-2018 Bob Beck <beck@openbsd.org>
@@ -741,6 +741,7 @@ test_slash(int do_uv)
{
extern char **environ;
if (do_uv) {
+ printf("testing unveil(\"/\")\n");
if (unveil("/bin/sh", "x") == -1)
err(1, "%s:%d - unveil", __FILE__, __LINE__);
if (unveil("/", "r") == -1)
@@ -750,6 +751,18 @@ test_slash(int do_uv)
}
static int
+test_dot(int do_uv)
+{
+ extern char **environ;
+ if (do_uv) {
+ printf("testing unveil(\".\")\n");
+ if (unveil(".", "rwxc") == -1)
+ err(1, "%s:%d - unveil", __FILE__, __LINE__);
+ }
+ return 0;
+}
+
+static int
test_bypassunveil(int do_uv)
{
if (do_uv) {
@@ -804,6 +817,7 @@ main (int argc, char *argv[])
failures += runcompare(test_realpath);
failures += runcompare(test_parent_dir);
failures += runcompare(test_slash);
+ failures += runcompare(test_dot);
failures += runcompare(test_bypassunveil);
failures += runcompare_internal(test_fork, 0);
exit(failures);