From nobody Wed Sep 17 12:19:24 2025 X-Original-To: dev-commits-src-main@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 4cRd9m49Qzz67HfM; Wed, 17 Sep 2025 12:19:24 +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 4cRd9m1cnlz3WM8; Wed, 17 Sep 2025 12:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758111564; 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=yfktoQ9WbHYmYHa75BUnJvacqhayFIcz5rl7d1Plvpk=; b=SY1Dhy1v58GDD/cvolvQhb0s8HnLtlWuP8/Wanrjyum0+hzqjApLG7udLCQB1U2VHm3SWq 2rVwvyq1XFmfKXfxvDEUHCA0/Dhw0/icphS5ktQqphumJFd1Pze3IsXbdtNHMNhqKHpOvO PasQwDfBCmK3h4aTdFSvREDk9gXEOI8LFMw1OVDOGwa+lhIM0qrzI3OKhclHqUyO0X7xt/ tjuEtXokkjieOTag4Xh4UJuMbMVIbqzbcrLGObaLo5/9d9KF496mQxmL5kGQn8bBxVIEP5 KxA49T2NnijKuUSRseOdJ3r9QZ8J28z9J+N11IG0JuySu3w6z8xY3I0Lo/DVAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758111564; 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=yfktoQ9WbHYmYHa75BUnJvacqhayFIcz5rl7d1Plvpk=; b=I4MtC1WPnAh+jqCPtIbjiaX2m1mf08jhIWivOogrv7j0epCY90178/O+LVGt+I54tQIvQF X7TelwiL31mm2wrxFihxEIVHMkiblj1A3Km+xuvBLlFOE0zA5/+gVbkUCfg3OpCpob5d7M QVgfHqA35MQAUss5MMjjJmpLoNAGCeSm7PexgHKgp1bAwSsU9FQTLoSrAKjlJBEegBGxgt tK2+D9ZRXb4jOFrNZroDYmSzKcCZ7IeBogydSESC776ljKMDSy1lpfqgIM5SU8Sn3rkPI7 weY6nhvrMWRjY5nobwB0KfIWYvOEioKzFXSPuy3GxFFFozWwK6orW+zuNEiFfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758111564; a=rsa-sha256; cv=none; b=sQ58PDPAy4Md4NAFaPPiLjAq8HyfCsmib9CLYN4tWz6tiAN5S9Q7R4Z97+lQ8Je5ZnQKFi /rsX0YbZ3JlqKQarukhWccAXx2kTk33FSvxBeGRKVoJIUAAWhXexVwwSXGXTNJLlUI1cwU NvVkSdOgnu67WB6H4r7DB7Wh8MIJyJFfR0TitIXxSDW/mvVZcrqyjjTtj0XLKH1cOlAPAu 6cM8wn0nQL2HdsxsU6pHZjQwFyh1eqAQWrclF4bYWjNRsXOpRzlPeM6Zgyb4QshVrGKIPe xBoDDDXU4eJkDhd90ZOz0PG9eg5faVFB4scU83x7BNA6lUVJ12suyglt3i1Z6g== 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 4cRd9m19YTz9Lv; Wed, 17 Sep 2025 12:19:24 +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 58HCJOYp086329; Wed, 17 Sep 2025 12:19:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58HCJOHY086326; Wed, 17 Sep 2025 12:19:24 GMT (envelope-from git) Date: Wed, 17 Sep 2025 12:19:24 GMT Message-Id: <202509171219.58HCJOHY086326@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: ff7252cdafbd - main - tools/regression/priv: Don't call setgroups() with the effective GID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: ff7252cdafbd9dab104a5e7b33b8bb84117a8789 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ff7252cdafbd9dab104a5e7b33b8bb84117a8789 commit ff7252cdafbd9dab104a5e7b33b8bb84117a8789 Author: Olivier Certner AuthorDate: 2025-08-29 17:00:07 +0000 Commit: Olivier Certner CommitDate: 2025-09-17 12:16:08 +0000 tools/regression/priv: Don't call setgroups() with the effective GID The 'setgroups(0, NULL);' stance works the same on all versions of FreeBSD, getting rid of all supplementary groups. The replaced code would force the effective GID to also be a supplementary group. Fixes: 9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms") MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52289 --- tools/regression/priv/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/regression/priv/main.c b/tools/regression/priv/main.c index dbcb5759f6b9..979e6ed65284 100644 --- a/tools/regression/priv/main.c +++ b/tools/regression/priv/main.c @@ -423,12 +423,10 @@ setup_file(const char *test, char *fpathp, uid_t uid, gid_t gid, mode_t mode) static void set_creds(const char *test, uid_t uid, gid_t gid) { - gid_t gids[1] = { gid }; - if (setgid(gid) < 0) err(-1, "test %s: setegid(%d)", test, gid); - if (setgroups(sizeof(gids)/sizeof(gid_t), gids) < 0) - err(-1, "test %s: setgroups(%d)", test, gid); + if (setgroups(0, NULL) < 0) + err(-1, "test %s: setgroups(NULL)", test); if (setuid(uid) < 0) err(-1, "test %s: seteuid(%d)", test, uid); }