From 176a5624327422e7899e7ae2d7d47754cb668ec5 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Wed, 29 May 2019 13:54:00 +0000 Subject: Add some more relative path tests --- regress/sys/kern/realpath/realpathtest.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'regress/sys') 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 @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -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); -- cgit v1.2.3