From nobody Fri Oct 10 17:03:47 2025 X-Original-To: dev-commits-src-branches@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 4cjtPJ1FQsz6Bbnh; Fri, 10 Oct 2025 17:03:48 +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 4cjtPJ0J5mz3dRV; Fri, 10 Oct 2025 17:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760115828; 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=eH85ydQbHeGHG4g9ls2JB4VxPjzH+bHkbjf6PlQVSV4=; b=Ve7mXw8blS9oGLcio6EmdhvKvJlhYZuu0yoWuBGK1hEGWluf6xdIbu9dF/bjddxE4nBid0 8/N29JPJ2UnC3deqpSzmDAr2GwZR/4PHCT/ZVIHUIZqEGArIiYfmw8p4OwL5RrDCEzoOEt VEFcuN38Zj+T0bMVojREXHna/bz4K1V1X7a0f7t1tinhWBrnI7bXtqiN0sBmjsKM2cuw7C wGPUysOt5R19grkD+kcaoJX6F4pLDayjP9HkQHsxOdGeKXnOL3Om9WCKTN61fHcQH10t5q DAwW6nzCkOss7D6jp4A5x1ghHrL/PayqY9jsdwqJ9BP8VhuZifxRBnSwnY9r+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760115828; 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=eH85ydQbHeGHG4g9ls2JB4VxPjzH+bHkbjf6PlQVSV4=; b=uHAI+E6mrtK818lDd3roPbQ2Nxijqo6M3rtQUTQi1BF+I5HnqGcLRjtgVh2N8O/P5lnGk/ G5JlibOr0ru/uN7YpB3Mhp/7S8sXBVIa94fcBEjJZkrESz0O6YNublzvNxQiJQ6FSEPClo X8bO1ytVwZM08XVxNlZ4HBtoQu+hYENhRaYhdfSHt5A+/tFCvaWvtLBAeFVH/BZleYuQDy RELC1fJPVkTv2juxbHZ66JCLNLU07IS3Zot9pMBGn6f3DRLY+lz3krd8CR52AKNNzKZ2Ne S9BB3HCdoQb98uzezvzUI5mTtQ6jHOUApLKbS4WkyFY1IOZcLnAV9wb/3qM/tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760115828; a=rsa-sha256; cv=none; b=uzUdsJBb9Ka7kESEu2ZIwO04iiIWzrZQJ++kbku4cUJkKM0P4Cl2WAwVxYxFBa86cHG8up PnfnmQYMApMInfJqcpJnEOAP/ntdoSqzXwgxitrc2BqpmlM6P478Z2z0X0ZG8btUFOFAbX HxqrVscuHTczhYe+jjeN7JB0WoKfDNuZkSqHZ5mx/+XD3tRADym1IzrEdMAyt9ZVoH5kMp pH5J7ti51H2p2n357sg4PK3UhrKxc30dNlnmhrBEsEsMGJfqKGDaGL4euHy6wnbJSJYjPb LXMmC2YL3w++pNU6NMAERip13tI2RmhLeS1u6jxE/Ci9Brpoz8wuL95yL/lB+A== 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 4cjtPH6tJsz19MP; Fri, 10 Oct 2025 17:03:47 +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 59AH3lXY088591; Fri, 10 Oct 2025 17:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59AH3l7J088588; Fri, 10 Oct 2025 17:03:47 GMT (envelope-from git) Date: Fri, 10 Oct 2025 17:03:47 GMT Message-Id: <202510101703.59AH3l7J088588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 59f602e2f229 - stable/15 - getgroups.2: Simplifications; Be clearer on programs to be modified List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 59f602e2f229fb20c6da7675db98e92c72ac2591 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=59f602e2f229fb20c6da7675db98e92c72ac2591 commit 59f602e2f229fb20c6da7675db98e92c72ac2591 Author: Olivier Certner AuthorDate: 2025-10-10 15:49:47 +0000 Commit: Olivier Certner CommitDate: 2025-10-10 17:03:16 +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 (cherry picked from commit c363dcbe75b2c7171611815daec82d263607ee37) --- 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