libselinux: turn into dlopen() dep

This commit is contained in:
Lennart Poettering
2025-09-26 11:12:04 +02:00
parent 26cde6f0ce
commit 83b6ef9b62
20 changed files with 248 additions and 97 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ executables += [
'extract' : nspawn_extract_sources,
'dependencies' : [
libseccomp_cflags,
libselinux,
libselinux_cflags,
],
},
nspawn_test_template + {
+3 -6
View File
@@ -13,10 +13,6 @@
#include <sys/wait.h>
#include <unistd.h>
#if HAVE_SELINUX
#include <selinux/selinux.h>
#endif
#include "sd-bus.h"
#include "sd-daemon.h"
#include "sd-event.h"
@@ -104,6 +100,7 @@
#include "rm-rf.h"
#include "runtime-scope.h"
#include "seccomp-util.h"
#include "selinux-util.h"
#include "shift-uid.h"
#include "signal-util.h"
#include "siphash24.h"
@@ -3532,8 +3529,8 @@ static int inner_child(
}
#if HAVE_SELINUX
if (arg_selinux_context)
if (setexeccon(arg_selinux_context) < 0)
if (arg_selinux_context && mac_selinux_use())
if (sym_setexeccon_raw(arg_selinux_context) < 0)
return log_error_errno(errno, "setexeccon(\"%s\") failed: %m", arg_selinux_context);
#endif