Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Feb 2021 16:35:58 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 92cf69cb8da6 - stable/12 - libcasper/cap_grp tests: Reset the group database handle
Message-ID:  <202102201635.11KGZwee028896@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=92cf69cb8da62688a9e77cb1baeab083d075728d

commit 92cf69cb8da62688a9e77cb1baeab083d075728d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-01-21 19:30:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
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";



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102201635.11KGZwee028896>