repart: load libraries before forking off child

This commit is contained in:
Lennart Poettering
2025-11-21 17:09:21 +01:00
parent 52594c3184
commit 09596e7d1a
2 changed files with 5 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ executables += [
'dependencies' : [
libblkid_cflags,
libfdisk,
libmount_cflags,
libopenssl,
threads,
],
@@ -35,6 +36,7 @@ executables += [
'dependencies' : [
libblkid_cflags,
libfdisk,
libmount_cflags,
libopenssl,
threads,
],

View File

@@ -50,6 +50,7 @@
#include "initrd-util.h"
#include "io-util.h"
#include "json-util.h"
#include "libmount-util.h"
#include "list.h"
#include "loop-util.h"
#include "main-func.h"
@@ -6616,6 +6617,8 @@ static int partition_populate_filesystem(Context *context, Partition *p, const c
* appear in the host namespace. Hence we fork a child that has its own file system namespace and
* detached mount propagation. */
(void) dlopen_libmount();
r = safe_fork("(sd-copy)", FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_WAIT|FORK_NEW_MOUNTNS|FORK_MOUNTNS_SLAVE, NULL);
if (r < 0)
return r;