From: beck Date: Fri, 27 Jul 2018 01:41:39 +0000 (+0000) Subject: add regress for unveil of "." now that I fixed this X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ff8da2f7c86a34a1ed3244d926c4505498fea940;p=openbsd add regress for unveil of "." now that I fixed this --- 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 @@ -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) @@ -749,6 +750,18 @@ test_slash(int do_uv) return 0; } +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) { @@ -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);