From owner-dev-commits-src-branches@freebsd.org Sat Feb 20 16:36:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D738554CFFC; Sat, 20 Feb 2021 16:36:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DjYwb0BDQz3sRp; Sat, 20 Feb 2021 16:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 8083921F56; Sat, 20 Feb 2021 16:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11KGZwCg028897; Sat, 20 Feb 2021 16:35:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11KGZwee028896; Sat, 20 Feb 2021 16:35:58 GMT (envelope-from git) Date: Sat, 20 Feb 2021 16:35:58 GMT Message-Id: <202102201635.11KGZwee028896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 92cf69cb8da6 - stable/12 - libcasper/cap_grp tests: Reset the group database handle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 92cf69cb8da62688a9e77cb1baeab083d075728d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2021 16:36:01 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=92cf69cb8da62688a9e77cb1baeab083d075728d commit 92cf69cb8da62688a9e77cb1baeab083d075728d Author: Mark Johnston AuthorDate: 2021-01-21 19:30:19 +0000 Commit: Mark Johnston CommitDate: 2021-02-20 16:35:32 +0000 libcasper/cap_grp tests: Reset the group database handle Some tests verify that the capgrp capability does not permit calls to setgrent(3), but all tests need to ensure that they reset the capability's group database handle, otherwise the local process and casper process will be out of sync. The cap_pwd tests already handle this. Sponsored by: The FreeBSD Foundation (cherry picked from commit 1a05d9519de62cc0f7719a995fded0926d8b2747) --- lib/libcasper/services/cap_grp/tests/grp_test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libcasper/services/cap_grp/tests/grp_test.c b/lib/libcasper/services/cap_grp/tests/grp_test.c index e2bb5e22eb1a..1e84e293e214 100644 --- a/lib/libcasper/services/cap_grp/tests/grp_test.c +++ b/lib/libcasper/services/cap_grp/tests/grp_test.c @@ -321,6 +321,8 @@ test_cmds(cap_channel_t *origcapgrp) capgrp = cap_clone(origcapgrp); CHECK(capgrp != NULL); + cap_setgrent(capgrp); + cmds[0] = "getgrent"; cmds[1] = "getgrent_r"; cmds[2] = "getgrnam"; @@ -361,6 +363,8 @@ test_cmds(cap_channel_t *origcapgrp) capgrp = cap_clone(origcapgrp); CHECK(capgrp != NULL); + cap_setgrent(capgrp); + cmds[0] = "getgrent"; cmds[1] = "getgrent_r"; cmds[2] = "getgrnam";