summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2019-05-13 21:47:10 +0000
committerBob Beck <beck@cvs.openbsd.org>2019-05-13 21:47:10 +0000
commit7cecd5dcb800f259ed67a91501a9a7a2fd7262e0 (patch)
tree000fc560040de48758817b8aec55a30512151935 /regress
parent91e24e81937f3ed0568b89bfadca98a9b049fb1c (diff)
Document our currently incosnsistent behaviour and our current
sins which have been judged by Dr Posix as sinful...
Diffstat (limited to 'regress')
-rw-r--r--regress/sys/kern/realpath/realpathtest.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/regress/sys/kern/realpath/realpathtest.c b/regress/sys/kern/realpath/realpathtest.c
index b025d7b1c4b..e909fae1fe4 100644
--- a/regress/sys/kern/realpath/realpathtest.c
+++ b/regress/sys/kern/realpath/realpathtest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: realpathtest.c,v 1.5 2019/05/11 21:28:08 beck Exp $ */
+/* $OpenBSD: realpathtest.c,v 1.6 2019/05/13 21:47:09 beck Exp $ */
/*
* Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -143,7 +143,25 @@ main(int argc, char *argv[])
}
i-= 3;
strlcpy(big+i, "bsd/", 5);
- RP_SHOULD_SUCCEED(big, r2, r3); /* XXX is this right? */
+ RP_SHOULD_SUCCEED(big, r2, r3); /* XXX This is wrong by posix */
+
+ for (i = 0; i < (PATH_MAX - 5); i += 3) {
+ big[i] = '.';
+ big[i+1] = '.';
+ big[i+2] = '/';
+ }
+ i-= 3;
+ strlcpy(big+i, "derp", 5);
+ RP_SHOULD_SUCCEED(big, r2, r3); /* XXX this is wrong by posix */
+
+ for (i = 0; i < (PATH_MAX - 6); i += 3) {
+ big[i] = '.';
+ big[i+1] = '.';
+ big[i+2] = '/';
+ }
+ i-= 3;
+ strlcpy(big+i, "derp/", 6);
+ RP_SHOULD_FAIL(big, r2, r3); /* XXX this is correct by posix */
for (i = 0; i < (PATH_MAX - 4); i += 3) {
big[i] = '.';