summaryrefslogtreecommitdiff
path: root/regress/sys/kern/unveil-unmount
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@cvs.openbsd.org>2023-10-12 16:59:25 +0000
committerAnton Lindqvist <anton@cvs.openbsd.org>2023-10-12 16:59:25 +0000
commit33ded035787b644231d24f048a5a4b0d3951bc31 (patch)
tree44c12a9acf4ca71cdc8b70e0738acb73a5833b73 /regress/sys/kern/unveil-unmount
parent46a1836d737090da58df2ae1bbb223981c40b898 (diff)
Let vnconfig select an unused device as opposed of unconditionally
assume vnd0 is available.
Diffstat (limited to 'regress/sys/kern/unveil-unmount')
-rw-r--r--regress/sys/kern/unveil-unmount/Makefile14
1 files changed, 7 insertions, 7 deletions
diff --git a/regress/sys/kern/unveil-unmount/Makefile b/regress/sys/kern/unveil-unmount/Makefile
index 810874203f6..e98b6b26064 100644
--- a/regress/sys/kern/unveil-unmount/Makefile
+++ b/regress/sys/kern/unveil-unmount/Makefile
@@ -1,27 +1,27 @@
-# $OpenBSD: Makefile,v 1.6 2020/12/17 14:22:42 bluhm Exp $
+# $OpenBSD: Makefile,v 1.7 2023/10/12 16:59:24 anton Exp $
# Call unveil(2) in combination with unlink(2), chroot(2), chdir(2).
# Use umount(8) to check that the mountpoint leaks no vnode.
# There were vnode reference counting bugs in the kernel.
PROGS= unveil-unlink unveil-chroot unveil-perm unveil-chdir
-CLEANFILES= diskimage
+CLEANFILES= diskimage vnd
.PHONY: mount unconfig clean
diskimage: unconfig
${SUDO} dd if=/dev/zero of=diskimage bs=512 count=4k
- ${SUDO} vnconfig vnd0 diskimage
- ${SUDO} newfs vnd0c
+ ${SUDO} vnconfig diskimage >vnd
+ ${SUDO} newfs $$(<vnd)c
mount: diskimage
${SUDO} mkdir -p /mnt/regress-unveil
- ${SUDO} mount /dev/vnd0c /mnt/regress-unveil
+ ${SUDO} mount /dev/$$(<vnd)c /mnt/regress-unveil
unconfig:
- -${SUDO} umount -f /dev/vnd0c 2>/dev/null || true
+ -${SUDO} umount -f /dev/$$(<vnd)c 2>/dev/null || true
-${SUDO} rmdir /mnt/regress-unveil 2>/dev/null || true
- -${SUDO} vnconfig -u vnd0 2>/dev/null || true
+ -${SUDO} vnconfig -u $$(<vnd) 2>/dev/null || true
-${SUDO} rm -f stamp-setup
REGRESS_SETUP = ${PROGS} mount