process-util: also disable dlopen() in safe_fork()

This commit is contained in:
Lennart Poettering
2025-11-24 11:56:47 +01:00
parent 9252e26f4c
commit a08f2ea02d
4 changed files with 29 additions and 2 deletions
+7
View File
@@ -20,6 +20,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "libmount-util.h"
#include "manager.h"
#include "mkdir.h"
#include "mount-util.h"
@@ -1604,6 +1605,8 @@ TEST(run_tests_unprivileged) {
}
static int intro(void) {
int r;
#if HAS_FEATURE_ADDRESS_SANITIZER
if (strstr_ptr(ci_environment(), "travis") || strstr_ptr(ci_environment(), "github-actions"))
return log_tests_skipped("Running on Travis CI/GH Actions under ASan, see https://github.com/systemd/systemd/issues/10696");
@@ -1621,6 +1624,10 @@ static int intro(void) {
if (path_is_read_only_fs("/sys") > 0)
return log_tests_skipped("/sys is mounted read-only");
r = dlopen_libmount();
if (r < 0)
return log_tests_skipped("libmount not available.");
/* Create dummy network interface for testing PrivateNetwork=yes */
have_net_dummy = system("ip link add dummy-test-exec type dummy") == 0;