summaryrefslogtreecommitdiffstats
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2011-04-23 14:57:01 +0000
committerderaadt <deraadt@openbsd.org>2011-04-23 14:57:01 +0000
commit4be14774e960c371fc4dc3866c8e70b48d248998 (patch)
tree3c800340d92c76121cf745d312dd1fe6d479905d /sys/dev/vnd.c
parentRemove yet another mention of /etc/security that i missed (doh). (diff)
downloadwireguard-openbsd-4be14774e960c371fc4dc3866c8e70b48d248998.tar.xz
wireguard-openbsd-4be14774e960c371fc4dc3866c8e70b48d248998.zip
backout the miod change since it is wrong
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index fc156d4deeb..917913d1b42 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.110 2011/04/22 21:28:56 miod Exp $ */
+/* $OpenBSD: vnd.c,v 1.111 2011/04/23 14:57:01 deraadt Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -226,11 +226,9 @@ vndopen(dev_t dev, int flags, int mode, struct proc *p)
part = DISKPART(dev);
pmask = 1 << part;
- /*
- * If any partition is open, all succeeding openings must be of the
- * same type or read-only.
- */
- if (sc->sc_dk.dk_openmask && (flags & FWRITE)) {
+ /* Allow access to the raw device even if we are open. */
+ if (sc->sc_dk.dk_openmask && !(part == RAW_PART) &&
+ !(mode == S_IFCHR)) {
error = EBUSY;
goto bad;
}