From nobody Wed Aug 27 11:41:31 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cBjKr0H6rz668XN for ; Wed, 27 Aug 2025 11:41:36 +0000 (UTC) (envelope-from ross@bisd.ro) Received: from ada.kiz.li (ada.kiz.li [38.45.72.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4cBjKp2DFkz3ZWJ; Wed, 27 Aug 2025 11:41:34 +0000 (UTC) (envelope-from ross@bisd.ro) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=reject) header.from=bisd.ro; spf=pass (mx1.freebsd.org: domain of ross@bisd.ro designates 38.45.72.165 as permitted sender) smtp.mailfrom=ross@bisd.ro Received: from [192.168.1.225] (syn-072-182-130-191.res.spectrum.com [72.182.130.191]) by ada.kiz.li (OpenSMTPD) with ESMTPSA id 6292833b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 27 Aug 2025 07:41:32 -0400 (EDT) Message-ID: Date: Wed, 27 Aug 2025 06:41:31 -0500 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: hastd not working, getgroups failure, COMPAT_FREEBSD14 enabled SUCCESS From: "S. Ross Gohlke" To: Kyle Evans , freebsd-current@FreeBSD.org References: <27174be9-3057-4e86-b21e-00fb133b77f9@bisd.ro> <943978ca-4825-43bf-94c2-9e539c56deab@FreeBSD.org> <6f584939-6639-436d-881d-f324b78511ed@bisd.ro> Content-Language: en-US In-Reply-To: <6f584939-6639-436d-881d-f324b78511ed@bisd.ro> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.61 / 15.00]; NEURAL_HAM_LONG(-0.98)[-0.982]; NEURAL_HAM_SHORT(-0.98)[-0.977]; DMARC_POLICY_ALLOW(-0.50)[bisd.ro,reject]; R_SPF_ALLOW(-0.20)[+mx]; ONCE_RECEIVED(0.20)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_MEDIUM(-0.06)[-0.055]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:174, ipnet:38.45.72.0/24, country:US]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCPT_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@FreeBSD.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4cBjKp2DFkz3ZWJ On 8/26/25 17:18, S. Ross Gohlke wrote: > > On 8/26/25 15:32, Kyle Evans wrote: >> On 8/26/25 15:05, S. Ross Gohlke wrote: >>> I tried running the latest PRERELEASE snapshot obtained from >>> , >>> published on Aug. 22. >>> >>> The hastd rc service starts but "hastctl status" fails with the >>> following error message: >>> [CRIT] Assertion failed: (getgroups(0, NULL) == 1), function >>> drop_privs, file /usr/src/sbin/hastd/subr.c, line 287. >>> >>> I have followed the "UPDATING stuff" thread on this list about 14 >>> compatibility, and my understanding is that getgroups syscalls >>> should work as long as the kernel has "options COMPAT_FREEBSD14" >>> enabled. >>> >>> I am running a custom kernel, but it is based on MINIMAL, so >>> "options COMPAT_FREEBSD14" is enabled. >>> >>> % sysctl kern.conftxt | grep COMPAT_FREEBSD14 >>> options    COMPAT_FREEBSD14 >>> >>> Am I doing something wrong? Might this be fixed in the next snapshot >>> (due Thursday)? >>> >> >> Bah; I had adjusted the assertions, but overlooked one that doesn't >> make sense.  The last >> two could probably be coalesced, but it's probably worth being sure >> that we don't still >> return one gid if room was created for whatever reason.  Try this: >> >> diff --git a/sbin/hastd/subr.c b/sbin/hastd/subr.c >> index 284fb0d07647..add1280e960b 100644 >> --- a/sbin/hastd/subr.c >> +++ b/sbin/hastd/subr.c >> @@ -284,7 +284,7 @@ drop_privs(const struct hast_resource *res) >>         PJDLOG_VERIFY(rgid == pw->pw_gid); >>         PJDLOG_VERIFY(egid == pw->pw_gid); >>         PJDLOG_VERIFY(sgid == pw->pw_gid); >> -       PJDLOG_VERIFY(getgroups(0, NULL) == 1); >> +       PJDLOG_VERIFY(getgroups(0, NULL) == 0); >>         PJDLOG_VERIFY(getgroups(1, gidset) == 0); >> >>         pjdlog_debug(1, >> > I patched /usr/src/sbin/hastd/subr.c (just edited the file) and > rebuilt hastctl and now it works. I did not have to rebuild hastd. > > # nano /usr/src/sbin/hastd/subr.c > > > > # cd /usr/src/sbin/hastctl > > # make -j8 > > # ./hastctl status > > Gives proper output and no error. > > > Thanks for the help and prompt response, > > Ross > Correction: I did have to rebuild hastd as well. While, "hastctl status" worked without it, "hastctl role primary all" did not until I rebuilt hastd. # cd /usr/src/sbin/hastd # make -j8 # cp -p ./hastd /sbin