diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2018-08-02 04:39:59 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2018-08-02 04:39:59 +0000 |
commit | 3092333580bc415b86624cf71ce4776fe34e6e74 (patch) | |
tree | 7643d3c5ac7c5ed698c0833dfabae83e6778ee3f /regress/sys | |
parent | 13726815a260c700738aeea745d0cf26ed403fbd (diff) |
Test messing with "." both when having . unveiled for an operation, and
with . veiled without the right flags for an operation, since these
come out of namei differently and . is the bane of the special
LOCKPARENT corner cases - this tests a panic found by anton@
Diffstat (limited to 'regress/sys')
-rw-r--r-- | regress/sys/kern/unveil/syscalls.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/regress/sys/kern/unveil/syscalls.c b/regress/sys/kern/unveil/syscalls.c index 91c11584cb1..6d8242ac070 100644 --- a/regress/sys/kern/unveil/syscalls.c +++ b/regress/sys/kern/unveil/syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscalls.c,v 1.14 2018/07/29 22:30:32 beck Exp $ */ +/* $OpenBSD: syscalls.c,v 1.15 2018/08/02 04:39:58 beck Exp $ */ /* * Copyright (c) 2017-2018 Bob Beck <beck@openbsd.org> @@ -755,9 +755,16 @@ test_dot(int do_uv) { extern char **environ; if (do_uv) { - printf("testing unveil(\".\")\n"); + printf("testing dot(\".\")\n"); if (unveil(".", "rwxc") == -1) err(1, "%s:%d - unveil", __FILE__, __LINE__); + if ((unlink(".") == -1) && errno != EPERM) + err(1, "%s:%d - unlink", __FILE__, __LINE__); + printf("testing dot flags(\".\")\n"); + if (unveil(".", "r") == -1) + err(1, "%s:%d - unveil", __FILE__, __LINE__); + if ((unlink(".") == -1) && errno != EACCES) + warn("%s:%d - unlink", __FILE__, __LINE__); } return 0; } |