summaryrefslogtreecommitdiff
path: root/regress/sys/kern
diff options
context:
space:
mode:
authorSebastien Marie <semarie@cvs.openbsd.org>2015-09-28 15:40:19 +0000
committerSebastien Marie <semarie@cvs.openbsd.org>2015-09-28 15:40:19 +0000
commitca3e975222c42bf7d4ac9f4fd3fdccd37deff133 (patch)
tree8dec86e740aa3286a35d710e54d369ae658fc9aa /regress/sys/kern
parent57187f60207da9f4df32f94dcc40a5523c250188 (diff)
make using tame path "/" work.
and add a regress test for that. ok deraadt@
Diffstat (limited to 'regress/sys/kern')
-rw-r--r--regress/sys/kern/tame/generic/main.c4
-rw-r--r--regress/sys/kern/tame/generic/tests.out8
2 files changed, 9 insertions, 3 deletions
diff --git a/regress/sys/kern/tame/generic/main.c b/regress/sys/kern/tame/generic/main.c
index 799e083f86c..adc19156c75 100644
--- a/regress/sys/kern/tame/generic/main.c
+++ b/regress/sys/kern/tame/generic/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.6 2015/09/27 17:55:39 semarie Exp $ */
+/* $OpenBSD: main.c,v 1.7 2015/09/28 15:40:18 semarie Exp $ */
/*
* Copyright (c) 2015 Sebastien Marie <semarie@openbsd.org>
*
@@ -234,7 +234,7 @@ main(int argc, char *argv[])
*/
start_test(&ret, "stdio rpath", NULL, test_wpaths);
start_test1(&ret, "stdio rpath", NULL, test_wpaths);
- // XXX start_test1(&ret, "stdio rpath", "/", test_wpaths);
+ start_test1(&ret, "stdio rpath", "/", test_wpaths);
start_test1(&ret, "stdio rpath", "/etc", test_wpaths);
start_test1(&ret, "stdio rpath", "/etc/", test_wpaths);
start_test1(&ret, "stdio rpath", "/etc/passwd", test_wpaths);
diff --git a/regress/sys/kern/tame/generic/tests.out b/regress/sys/kern/tame/generic/tests.out
index bdcb16316e6..3b55f50f421 100644
--- a/regress/sys/kern/tame/generic/tests.out
+++ b/regress/sys/kern/tame/generic/tests.out
@@ -1,4 +1,4 @@
-# $OpenBSD: tests.out,v 1.5 2015/09/27 17:55:39 semarie Exp $
+# $OpenBSD: tests.out,v 1.6 2015/09/28 15:40:18 semarie Exp $
test(test_nop): tame=("",NULL) status=0 exit=0
test(test_inet): tame=("",NULL) status=9 signal=9 tamed_syscall=97
test(test_inet): tame=("abort",NULL) status=134 signal=6 coredump=present tamed_syscall=97
@@ -33,6 +33,12 @@ test(test_wpaths): tame=("stdio rpath",{NULL})
open_close("../../../../../../../../../../../../../../../etc/passwd") fd=-1 errno=2
open_close("/nonexistent") fd=-1 errno=2
status=0 exit=0
+test(test_wpaths): tame=("stdio rpath",{"/",NULL})
+ open_close("/etc/passwd") fd=3 errno=0
+ open_close("generic") fd=3 errno=0
+ open_close("../../../../../../../../../../../../../../../etc/passwd") fd=3 errno=0
+ open_close("/nonexistent") fd=-1 errno=2
+ status=0 exit=0
test(test_wpaths): tame=("stdio rpath",{"/etc",NULL})
open_close("/etc/passwd") fd=3 errno=0
open_close("generic") fd=-1 errno=2