summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2019-08-06 11:38:16 +0000
committerbluhm <bluhm@openbsd.org>2019-08-06 11:38:16 +0000
commit860a60119c253c35516b9fdd12352bd1961fb26b (patch)
treed3e89ba5e35acde676e092a115142038c16ffe65
parentUse pw->pw_dir when chroot'ing, not _PATH_VAREMPTY. (diff)
downloadwireguard-openbsd-860a60119c253c35516b9fdd12352bd1961fb26b.tar.xz
wireguard-openbsd-860a60119c253c35516b9fdd12352bd1961fb26b.zip
Test more variants to specify the root directory.
-rw-r--r--regress/sys/kern/realpath/realpathtest.c6
-rw-r--r--regress/sys/kern/unveil-unmount/Makefile18
2 files changed, 22 insertions, 2 deletions
diff --git a/regress/sys/kern/realpath/realpathtest.c b/regress/sys/kern/realpath/realpathtest.c
index baf511e57cf..98f9342baa4 100644
--- a/regress/sys/kern/realpath/realpathtest.c
+++ b/regress/sys/kern/realpath/realpathtest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: realpathtest.c,v 1.12 2019/08/05 23:32:03 bluhm Exp $ */
+/* $OpenBSD: realpathtest.c,v 1.13 2019/08/06 11:38:16 bluhm Exp $ */
/*
* Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -104,6 +104,10 @@ main(int argc, char *argv[])
RP_SHOULD_FAIL("", NULL, NULL);
RP_SHOULD_SUCCEED("/", NULL, NULL);
RP_SHOULD_SUCCEED("//", NULL, NULL);
+ RP_SHOULD_SUCCEED("/./", NULL, NULL);
+ RP_SHOULD_SUCCEED("/./.", NULL, NULL);
+ RP_SHOULD_SUCCEED("/./..", NULL, NULL);
+ RP_SHOULD_SUCCEED("/../../", NULL, NULL);
RP_SHOULD_SUCCEED("/tmp", NULL, NULL);
RP_SHOULD_FAIL("/tmp/noreallydoesntexist", NULL, NULL);
RP_SHOULD_FAIL("/tmp/noreallydoesntexist/stillnope", NULL, NULL);
diff --git a/regress/sys/kern/unveil-unmount/Makefile b/regress/sys/kern/unveil-unmount/Makefile
index bb8b77ee1a1..347e06cc409 100644
--- a/regress/sys/kern/unveil-unmount/Makefile
+++ b/regress/sys/kern/unveil-unmount/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2019/08/05 23:32:04 bluhm Exp $
+# $OpenBSD: Makefile,v 1.4 2019/08/06 11:38:16 bluhm Exp $
# Call unveil(2) in combination with unlink(2), chroot(2), chdir(2).
# Use umount(8) to check that the mountpoint leaks no vnode.
@@ -121,6 +121,22 @@ run-chroot-open-rootslash:
${SUDO} ./unveil-chroot /mnt/regress-unveil / //baz
${SUDO} umount /mnt/regress-unveil
+REGRESS_TARGETS += run-chroot-unveil-rootdot-open
+run-chroot-unveil-rootdotdot-open:
+ @echo '\n======== $@ ========'
+ ${SUDO} mkdir -p /mnt/regress-unveil
+ ${SUDO} touch /mnt/regress-unveil/baz
+ ${SUDO} ./unveil-chroot /mnt/regress-unveil /. /baz
+ ${SUDO} umount /mnt/regress-unveil
+
+REGRESS_TARGETS += run-chroot-unveil-rootdotdot-open
+run-chroot-unveil-rootdotdot-open:
+ @echo '\n======== $@ ========'
+ ${SUDO} mkdir -p /mnt/regress-unveil
+ ${SUDO} touch /mnt/regress-unveil/baz
+ ${SUDO} ./unveil-chroot /mnt/regress-unveil /.. /baz
+ ${SUDO} umount /mnt/regress-unveil
+
REGRESS_TARGETS += run-perm
run-perm:
@echo '\n======== $@ ========'