aboutsummaryrefslogtreecommitdiff
path: root/lib/libcasper/services/cap_grp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcasper/services/cap_grp')
-rw-r--r--lib/libcasper/services/cap_grp/Makefile4
-rw-r--r--lib/libcasper/services/cap_grp/cap_grp.39
-rw-r--r--lib/libcasper/services/cap_grp/cap_grp.c1
-rw-r--r--lib/libcasper/services/cap_grp/cap_grp.h1
-rw-r--r--lib/libcasper/services/cap_grp/tests/Makefile1
-rw-r--r--lib/libcasper/services/cap_grp/tests/Makefile.depend8
-rw-r--r--lib/libcasper/services/cap_grp/tests/grp_test.c2
7 files changed, 18 insertions, 8 deletions
diff --git a/lib/libcasper/services/cap_grp/Makefile b/lib/libcasper/services/cap_grp/Makefile
index b46f3bfdaa47..a921dfa87e7c 100644
--- a/lib/libcasper/services/cap_grp/Makefile
+++ b/lib/libcasper/services/cap_grp/Makefile
@@ -1,4 +1,3 @@
-
SHLIBDIR?= /lib
.include <src.opts.mk>
@@ -40,3 +39,6 @@ MLINKS+=cap_grp.3 cap_grp_limit_fields.3
MLINKS+=cap_grp.3 cap_grp_limit_groups.3
.include <bsd.lib.mk>
+
+# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501
+CFLAGS.cap_grp.c+= ${NO_WUSE_AFTER_FREE}
diff --git a/lib/libcasper/services/cap_grp/cap_grp.3 b/lib/libcasper/services/cap_grp/cap_grp.3
index 7c1bf0320e25..578d8edffbfa 100644
--- a/lib/libcasper/services/cap_grp/cap_grp.3
+++ b/lib/libcasper/services/cap_grp/cap_grp.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd May 5, 2020
+.Dd December 6, 2023
.Dt CAP_GRP 3
.Os
.Sh NAME
@@ -59,7 +59,7 @@
.Fn cap_getgrgid_r "cap_channel_t *chan" "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result"
.Ft int
.Fn cap_setgroupent "cap_channel_t *chan" "int stayopen"
-.Ft int
+.Ft int
.Fn cap_setgrent "cap_channel_t *chan"
.Ft void
.Fn cap_endgrent "cap_channel_t *chan"
@@ -152,6 +152,11 @@ The
and
.Fa ngids
variables provide numbers of limited names and gids.
+.Pp
+All of these functions are reentrant but not thread-safe.
+That is, they may be called from separate threads only with different
+.Vt cap_channel_t
+arguments or with synchronization.
.Sh EXAMPLES
The following example first opens a capability to casper and then uses this
capability to create the
diff --git a/lib/libcasper/services/cap_grp/cap_grp.c b/lib/libcasper/services/cap_grp/cap_grp.c
index 6a5ad84fcd22..025ce00adf56 100644
--- a/lib/libcasper/services/cap_grp/cap_grp.c
+++ b/lib/libcasper/services/cap_grp/cap_grp.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2013 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Pawel Jakub Dawidek under sponsorship from
* the FreeBSD Foundation.
diff --git a/lib/libcasper/services/cap_grp/cap_grp.h b/lib/libcasper/services/cap_grp/cap_grp.h
index a478a91cf760..9be2e7a78dd5 100644
--- a/lib/libcasper/services/cap_grp/cap_grp.h
+++ b/lib/libcasper/services/cap_grp/cap_grp.h
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2013 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Pawel Jakub Dawidek under sponsorship from
* the FreeBSD Foundation.
diff --git a/lib/libcasper/services/cap_grp/tests/Makefile b/lib/libcasper/services/cap_grp/tests/Makefile
index 18074380b7f0..f57d58972c52 100644
--- a/lib/libcasper/services/cap_grp/tests/Makefile
+++ b/lib/libcasper/services/cap_grp/tests/Makefile
@@ -1,4 +1,3 @@
-
.include <src.opts.mk>
TAP_TESTS_C= grp_test
diff --git a/lib/libcasper/services/cap_grp/tests/Makefile.depend b/lib/libcasper/services/cap_grp/tests/Makefile.depend
index 11aba52f82cf..fd331b1176a3 100644
--- a/lib/libcasper/services/cap_grp/tests/Makefile.depend
+++ b/lib/libcasper/services/cap_grp/tests/Makefile.depend
@@ -1,6 +1,14 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcasper/libcasper \
+ lib/libcasper/services/cap_grp \
+ lib/libcompiler_rt \
+ lib/libnv \
.include <dirdeps.mk>
diff --git a/lib/libcasper/services/cap_grp/tests/grp_test.c b/lib/libcasper/services/cap_grp/tests/grp_test.c
index c120c61e0cf1..d7e9cf12954a 100644
--- a/lib/libcasper/services/cap_grp/tests/grp_test.c
+++ b/lib/libcasper/services/cap_grp/tests/grp_test.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2013 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Pawel Jakub Dawidek under sponsorship from
* the FreeBSD Foundation.
@@ -29,7 +28,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
#include <sys/capsicum.h>
#include <sys/nv.h>