about [UPDATING] [RELNOTES]summaryrefslograw-logtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Cochard <olivier@FreeBSD.org>2026-08-05 21:46:10 +0100
committerKonstantin Belousov <kib@FreeBSD.org>2026-09-05 03:24:50 +0100
commit8ab5624f401c4830e0bbbe9f5287fc1a14d4864c (patch) (diff)
tree0eacaeeeceab1b0d24d9baf8e50ba2964f6e120b
downloadsrc-stable/15.tar.gz
 
previous commitc41e308ef27bda0b8149931923c6721aa321aad9 (tty: gracefully handle proctree_lock locking)
tests/sys/kern: Skip capsicum procdesc tests when capability mode is unavailable HEADstable/15
(cherry picked from commit 3c5c55beee5ef80d8a9526480682cee86cbac584)
-rw-r--r--tests/sys/kern/Makefile[diff] [file]2
-rw-r--r--tests/sys/kern/pdwait.c[diff] [file]7
-rw-r--r--tests/sys/kern/procdesc.c[diff] [file]4
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index b76303d120ba..5545b1200904 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -156,6 +156,8 @@ SRCS.subr_unit_test+= subr_unit.c
CFLAGS.exterr_test+= -I${SRCTOP}/tests
CFLAGS.ptrace_test+= -I${SRCTOP}/tests
+CFLAGS.pdwait+= -I${SRCTOP}/tests
+CFLAGS.procdesc+= -I${SRCTOP}/tests
WARNS?= 3
diff --git a/tests/sys/kern/pdwait.c b/tests/sys/kern/pdwait.c
index f95cbe2c3a4f..aae0891129e7 100644
--- a/tests/sys/kern/pdwait.c
+++ b/tests/sys/kern/pdwait.c
@@ -38,6 +38,8 @@
#include <signal.h>
#include <string.h>
+#include "freebsd_test_suite/macros.h"
+
static void*
unmapped(void) {
void *unmapped;
@@ -85,6 +87,8 @@ ATF_TC_BODY(capsicum, tc)
pid_t pid;
int status, r;
+ ATF_REQUIRE_FEATURE("security_capability_mode");
+
pid = pdfork(&fdp, 0);
if (pid == 0)
_exit(42);
@@ -195,6 +199,9 @@ ATF_TC_BODY(enotcap, tc)
pid_t pid;
int status;
+ ATF_REQUIRE_FEATURE("security_capability_mode");
+ ATF_REQUIRE_FEATURE("security_capabilities");
+
/*cap_rights_init(&rights, CAP_RIGHTS_ALL);*/
CAP_ALL(&rights);
cap_rights_clear(&rights, CAP_PDWAIT);
diff --git a/tests/sys/kern/procdesc.c b/tests/sys/kern/procdesc.c
index 4e36c58ce2f2..d6f19548bd05 100644
--- a/tests/sys/kern/procdesc.c
+++ b/tests/sys/kern/procdesc.c
@@ -49,6 +49,8 @@
#include <atf-c.h>
#include <kvm.h>
+#include "freebsd_test_suite/macros.h"
+
/* Tests for procdesc(4) that aren't specific to any one syscall */
/*
@@ -348,6 +350,8 @@ ATF_TC_BODY(pdopenpid_child, tc)
{
pid_t child, parent;
+ ATF_REQUIRE_FEATURE("security_capability_mode");
+
parent = getpid();
child = fork();
ATF_REQUIRE_MSG(child >= 0, "fork: %s", strerror(errno));
This site is maintained by Jamie Landeg-Jones <jamie@catflap.org>, and is not an official FreeBSD project, nor is it endorsed by the FreeBSD team.