From 68ff4442271c395583a5d6a70bebcf56f44b7edf Mon Sep 17 00:00:00 2001 From: dv Date: Fri, 2 Feb 2024 14:58:02 +0000 Subject: [PATCH] Explain missing group on getgrnam(3) failure. vmd's use of agentx requires the agentx group, but if unavailable, no details were given to the user. Zap some whitespace whitespace while here. "that is better", deraadt@ --- usr.sbin/vmd/vm_agentx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/vmd/vm_agentx.c b/usr.sbin/vmd/vm_agentx.c index e54133f325a..af80964d68f 100644 --- a/usr.sbin/vmd/vm_agentx.c +++ b/usr.sbin/vmd/vm_agentx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_agentx.c,v 1.1 2022/09/13 10:28:19 martijn Exp $ */ +/* $OpenBSD: vm_agentx.c,v 1.2 2024/02/02 14:58:02 dv Exp $ */ /* * Copyright (c) 2022 Martijn van Duren @@ -106,7 +106,7 @@ vm_agentx(struct privsep *ps, struct privsep_proc *p) * group permissions. */ if ((grp = getgrnam(AGENTX_GROUP)) == NULL) - fatal("getgrnam"); + fatal("failed to get group: %s", AGENTX_GROUP); ps->ps_pw->pw_gid = grp->gr_gid; proc_run(ps, p, procs, nitems(procs), vm_agentx_run, NULL); @@ -135,7 +135,7 @@ vm_agentx_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg) { static struct vmop_info_result *vir = NULL; static struct vmop_info_result *mvir = NULL; - struct vmd *env = p->p_ps->ps_env; + struct vmd *env = p->p_ps->ps_env; struct vmop_info_result *tvir; struct agentx_object *reqObject; static size_t nvir = 0; @@ -326,7 +326,7 @@ vm_agentx_configure(struct vmd_agentx *env) if ((vmMIB = agentx_region(ctx, AGENTX_OID(VMMIB), 1)) == NULL) fatal("agentx_region vmMIB"); - + if ((vmIndex = agentx_index_integer_dynamic(vmMIB, AGENTX_OID(VMINDEX))) == NULL) fatal("agentx_index_integer_dynamic"); -- 2.20.1