From: Lennart Poettering Date: Fri, 21 Nov 2025 16:09:21 +0000 (+0100) Subject: repart: load libraries before forking off child X-Git-Tag: v259-rc2~34^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09596e7d1a540a78e984c196d776102914b4239f;p=thirdparty%2Fsystemd.git repart: load libraries before forking off child --- diff --git a/src/repart/meson.build b/src/repart/meson.build index 1478ae278a9..b922ecb7130 100644 --- a/src/repart/meson.build +++ b/src/repart/meson.build @@ -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, ], diff --git a/src/repart/repart.c b/src/repart/repart.c index ea44775eece..497654d012d 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -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;