diff options
| author | 2018-06-26 10:00:08 +0000 | |
|---|---|---|
| committer | 2018-06-26 10:00:08 +0000 | |
| commit | 6cfffd577b03d2f54eda873c3414b64f23c82b46 (patch) | |
| tree | 7da0d1fd57b179ca847fce244f991a128146034d /usr.sbin/vmd/vmd.c | |
| parent | Allow to read the password from a file with -y (diff) | |
| download | wireguard-openbsd-6cfffd577b03d2f54eda873c3414b64f23c82b46.tar.xz wireguard-openbsd-6cfffd577b03d2f54eda873c3414b64f23c82b46.zip | |
Add "socket owner" to allow changing the owner of the vmd control socket.
This allows to open vmctl control or console access to other users
that are not in group wheel. Access for non-root users still defaults
to read-only actions unless you change the owner (user/group) of each
individual VM.
Requested by Mischa Peters
OK mlarkin@
Diffstat (limited to 'usr.sbin/vmd/vmd.c')
| -rw-r--r-- | usr.sbin/vmd/vmd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index cc2af555a16..9b1c66e2a52 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.86 2018/06/19 17:12:34 reyk Exp $ */ +/* $OpenBSD: vmd.c,v 1.87 2018/06/26 10:00:08 reyk Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -85,6 +85,7 @@ vmd_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg) struct vmd_vm *vm = NULL; char *str = NULL; uint32_t id = 0; + struct control_sock *rcs; switch (imsg->hdr.type) { case IMSG_VMDOP_START_VM_REQUEST: @@ -275,6 +276,12 @@ vmd_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg) NULL, 0); } break; + case IMSG_VMDOP_DONE: + control_reset(&ps->ps_csock); + TAILQ_FOREACH(rcs, &ps->ps_rcsocks, cs_entry) + control_reset(rcs); + cmd = 0; + break; default: return (-1); } |
