From: dv Date: Fri, 2 Feb 2024 14:58:02 +0000 (+0000) Subject: Explain missing group on getgrnam(3) failure. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=68ff4442271c395583a5d6a70bebcf56f44b7edf;p=openbsd 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@ --- 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");