From nobody Fri Oct 10 15:57:44 2025 X-Original-To: dev-commits-src-all@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 4cjrx52H6dz6BVhS; Fri, 10 Oct 2025 15:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cjrx50wxPz3Wst; Fri, 10 Oct 2025 15:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760111865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hCbyZ/K3y2IlK6NPPwyAM5wnlpfKDDPMcrfRgKzKLok=; b=K4YlgVsTCvskQEizn/BFeZiDFwbgqmaErecd0jYYu6GiIqJML6gSf/+t3ftOkARWiYEbkP meCEtjS1zHeM+FSYGvCOP/hBYt10gZA7eN2aJZluiIImIysZqAfR0940To03NPY4GIqO/F fUYG5WJiXdf/r9OCh2SYeK1q7jmtRpnpZhdSwveEhv6DhP0DTN/dfVmJqAZ69QbKnIp+6u iFiES6p0aTHMq7mk95pgz8JIzvOhVq2bEozKW5NsycGwZITe/M668vL4iRD7rq3/KQfDmN HgTe6EYqNHoqvXb1cRHIEj9zJ0CVw13ER5A57qCNFLqfSX+TX94ZFX6yyPUfFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760111865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hCbyZ/K3y2IlK6NPPwyAM5wnlpfKDDPMcrfRgKzKLok=; b=Z6DbIrox77ZNzPGl/+fqX0zt8sOrE4wjZQI0PIY3snK+oIdupyibMnEShvU8PTOqZ33zhl 1OCx98Z+4mo8QaP6oqmoEODZU0HVSaMdlj6OuR/IWId4qbioAIRAMb67q0oVrsgn7jBfCo OrECQ1x8VzOPot5E2EPCaMj86xzQ7B4VvqalpRYLFfY6Gbrn4eby7/eXYFmeJW0JNkCjjS pYjAIqbEG8+wb3UiVkpP3kM7Q2UFh1Soz01u70/K4FUs8K6p4bIQz5eeiYBYUINTbael5I qvx9xPgtEi6rUgCkCb70uWAznPIlpNLIXPDpdRuDkuc1/lzg5HGwU3vXDUSvuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760111865; a=rsa-sha256; cv=none; b=x2H4WY9RrVDHUGtiRi025auRJexI4Qcc+6AlvDpJsdsRSmEApXuGKAnv8KlWLUYPA5zag2 ty6uubpa6Iqr166Q+guSdbMzOnsnOtEq5DrZufnO3Ypcpmvm9Kx8bvBE4Ri3xDa5iLLH8G zqIDij6a7YalGemRp61TWepXHP3l9afLuhXV14CFRk92qAqe2U5w03OYChpAmrXacfoSmz DJ62TSffKoMdV7aqV484Y15UDULoUjpUir9ht/NgiyUkWxWUbhBsi75DygUH8+zZoG5Qbt PdH5pv4k7NeLVgkNcbJTy1Q4wQYKodoB19AtIu0DapiL3WXZ0Y++rHv/E1AirA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cjrx508DPz18Pk; Fri, 10 Oct 2025 15:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59AFviBJ057079; Fri, 10 Oct 2025 15:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59AFvi91057076; Fri, 10 Oct 2025 15:57:44 GMT (envelope-from git) Date: Fri, 10 Oct 2025 15:57:44 GMT Message-Id: <202510101557.59AFvi91057076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: c363dcbe75b2 - main - getgroups.2: Simplifications; Be clearer on programs to be modified List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c363dcbe75b2c7171611815daec82d263607ee37 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c363dcbe75b2c7171611815daec82d263607ee37 commit c363dcbe75b2c7171611815daec82d263607ee37 Author: Olivier Certner AuthorDate: 2025-10-10 15:49:47 +0000 Commit: Olivier Certner CommitDate: 2025-10-10 15:57:24 +0000 getgroups.2: Simplifications; Be clearer on programs to be modified In the STANDARDS section, stop mentioning behavior that is not prescribed by POSIX and make sure to specify which alternative we implement (as POSIX allows to return or not the effective group ID). Say more clearly that programs treating specially the first slot of the returned array must be modified. Consistently use "group ID" instead of "GID". These changes are going to be MFCed into stable/14 as part of MFCing commit 4be38acc826f ("getgroups.2: Clarify, mention ascending order, add SECURITY CONSIDERATIONS"), so the current commit will be MFCed to stable/15 only. MFC after: 1 hour MFC to: stable/15 Sponsored by: The FreeBSD Foundation --- lib/libsys/getgroups.2 | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/libsys/getgroups.2 b/lib/libsys/getgroups.2 index 4881a65d532e..4e94b32d4e7b 100644 --- a/lib/libsys/getgroups.2 +++ b/lib/libsys/getgroups.2 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 17, 2025 +.Dd October 10, 2025 .Dt GETGROUPS 2 .Os .Sh NAME @@ -107,10 +107,8 @@ array. The .Fn getgroups system call conforms to -.St -p1003.1-2008 -with the additional properties that supplementary groups are reported in -strictly ascending order and the returned size coincides with the cardinal of -the set. +.St -p1003.1-2008 , +not reporting the effective group ID. .Sh HISTORY The .Fn getgroups @@ -121,8 +119,8 @@ Since .Fx 14.3 , the .Fn getgroups -system call has treated the supplementary groups as a set, reporting them in -strictly ascending order and returning the cardinal of the set. +system call has been reporting the supplementary groups in strictly ascending +order. .Pp Before .Fx 15.0 , @@ -138,15 +136,14 @@ system call gets the supplementary groups set in the array. In particular, as evoked in .Sx HISTORY , -it does not anymore retrieve the effective GID in the first slot of +it does not anymore retrieve the effective group ID in the first slot of .Fa gidset . -Programs should not make any assumption about which group is placed in the first -slot of -.Fa gidset -other than it being the supplementary group with smallest GID. +Programs that process this slot in a specific way must be modified to obtain the +effective group ID through other means, such as a call to +.Xr getegid 2 . .Pp -The effective GID is present in the supplementary groups set if and only if it -was explicitly set as a supplementary group. +The effective group ID is present in the supplementary groups set if and only if +it was explicitly set as a supplementary group. The function .Fn initgroups enforces that, while the