portabled: load a bunch of libs before we fork off a dissector child processes

This commit is contained in:
Lennart Poettering
2025-11-21 08:53:14 +01:00
parent 6069de1ed3
commit e683dce1f1
2 changed files with 8 additions and 0 deletions

View File

@@ -29,6 +29,8 @@ executables += [
'sources' : systemd_portabled_sources,
'link_with' : portabled_link_with,
'dependencies' : [
libcryptsetup_cflags,
libmount_cflags,
libselinux_cflags,
threads,
],

View File

@@ -12,6 +12,7 @@
#include "chase.h"
#include "conf-files.h"
#include "copy.h"
#include "cryptsetup-util.h"
#include "data-fd-util.h"
#include "dirent-util.h"
#include "discover-image.h"
@@ -28,6 +29,7 @@
#include "glyph-util.h"
#include "install.h"
#include "iovec-util.h"
#include "libmount-util.h"
#include "log-context.h"
#include "log.h"
#include "loop-util.h"
@@ -420,6 +422,10 @@ static int portable_extract_by_path(
BLOCK_SIGNALS(SIGCHLD);
/* Load some libraries before we fork workers off that want to use them */
(void) dlopen_cryptsetup();
(void) dlopen_libmount();
r = mkdtemp_malloc("/tmp/inspect-XXXXXX", &tmpdir);
if (r < 0)
return log_debug_errno(r, "Failed to create temporary directory: %m");