summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2019-05-29 13:54:00 +0000
committerBob Beck <beck@cvs.openbsd.org>2019-05-29 13:54:00 +0000
commit176a5624327422e7899e7ae2d7d47754cb668ec5 (patch)
tree9c32cf60bf329b2267bdba7b7cc3d03b1472a07d /regress/sys
parent9b8d6afe9380dcf939c339d098b56cc57a477e87 (diff)
Add some more relative path tests
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/kern/realpath/realpathtest.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/regress/sys/kern/realpath/realpathtest.c b/regress/sys/kern/realpath/realpathtest.c
index e909fae1fe4..db8532008f3 100644
--- a/regress/sys/kern/realpath/realpathtest.c
+++ b/regress/sys/kern/realpath/realpathtest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: realpathtest.c,v 1.6 2019/05/13 21:47:09 beck Exp $ */
+/* $OpenBSD: realpathtest.c,v 1.7 2019/05/29 13:53:59 beck Exp $ */
/*
* Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -17,6 +17,7 @@
*/
#include <sys/types.h>
+#include <sys/stat.h>
#include <stdio.h>
#include <limits.h>
@@ -112,6 +113,15 @@ main(int argc, char *argv[])
RP_SHOULD_FAIL("/../.../usr/bin", r2, r3);
RP_SHOULD_FAIL("/bsd/herp", r2, r3);
+ /* relative paths */
+ if (mkdir("hoobla", 0755) == -1) {
+ if (errno != EEXIST)
+ err(1, "mkdir");
+ }
+ RP_SHOULD_SUCCEED("hoobla", r2, r3);
+ RP_SHOULD_SUCCEED("hoobla/porkrind", r2, r3); /* XXX posix */
+ RP_SHOULD_FAIL("hoobla/porkrind/peepee", r2, r3);
+
/* total size */
memset(big, '/', PATH_MAX + 1);
RP_SHOULD_FAIL(big, r2, r3);