From d557eb84f3ecba7789f85a77b6d6bbfe03009189 Mon Sep 17 00:00:00 2001 From: abieber Date: Wed, 6 Dec 2017 13:29:02 +0000 Subject: [PATCH] Make vmd respect owner when starting non-disabled vms. OK pd@, benno@ --- usr.sbin/vmd/vmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index 894709cb407..469a2856338 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.75 2017/11/30 01:28:27 ccardenas Exp $ */ +/* $OpenBSD: vmd.c,v 1.76 2017/12/06 13:29:02 abieber Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -102,7 +102,7 @@ vmd_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg) cmd = IMSG_VMDOP_START_VM_RESPONSE; } if (res == 0 && - config_setvm(ps, vm, imsg->hdr.peerid, vmc.vmc_uid) == -1) { + config_setvm(ps, vm, imsg->hdr.peerid, vm->vm_params.vmc_uid) == -1) { res = errno; cmd = IMSG_VMDOP_START_VM_RESPONSE; } @@ -840,7 +840,7 @@ vmd_configure(void) vm->vm_params.vmc_params.vcp_name); continue; } - if (config_setvm(&env->vmd_ps, vm, -1, 0) == -1) + if (config_setvm(&env->vmd_ps, vm, -1, vm->vm_params.vmc_uid) == -1) return (-1); } @@ -918,7 +918,7 @@ vmd_reload(unsigned int reset, const char *filename) vm->vm_params.vmc_params.vcp_name); continue; } - if (config_setvm(&env->vmd_ps, vm, -1, 0) == -1) + if (config_setvm(&env->vmd_ps, vm, -1, vm->vm_params.vmc_uid) == -1) return (-1); } else { log_debug("%s: not creating vm \"%s\": " -- 2.20.1