summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd/vmd.c
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2018-03-14 07:29:34 +0000
committermlarkin <mlarkin@openbsd.org>2018-03-14 07:29:34 +0000
commit8c340e5d284cfddd80cf8e87565aeeab48e60970 (patch)
tree33924578c3ca3e15a7d8faa83c1dcaef6baa8338 /usr.sbin/vmd/vmd.c
parentknf (diff)
downloadwireguard-openbsd-8c340e5d284cfddd80cf8e87565aeeab48e60970.tar.xz
wireguard-openbsd-8c340e5d284cfddd80cf8e87565aeeab48e60970.zip
block two VMs from using the same disk image file at the same time.
Also changes an error message in vmctl to reflect same.
Diffstat (limited to 'usr.sbin/vmd/vmd.c')
-rw-r--r--usr.sbin/vmd/vmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c
index b987b1bd92f..354630401cd 100644
--- a/usr.sbin/vmd/vmd.c
+++ b/usr.sbin/vmd/vmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmd.c,v 1.80 2018/02/18 01:00:25 pd Exp $ */
+/* $OpenBSD: vmd.c,v 1.81 2018/03/14 07:29:34 mlarkin Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -811,9 +811,10 @@ vmd_configure(void)
* recvfd - for send and receive.
* getpw - lookup user or group id by name.
* chown, fattr - change tty ownership
+ * flock - locking disk files
*/
if (pledge("stdio rpath wpath proc tty recvfd sendfd getpw"
- " chown fattr", NULL) == -1)
+ " chown fattr flock", NULL) == -1)
fatal("pledge");
if (parse_config(env->vmd_conffile) == -1) {