From: Lennart Poettering Date: Wed, 1 Jul 2026 14:04:18 +0000 (+0200) Subject: mkfs-util: let's debug log about all fork off cmdlines X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4502c72c828842f530069cf10addb72da239a16;p=thirdparty%2Fsystemd.git mkfs-util: let's debug log about all fork off cmdlines --- diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c index 80c509f99b0..33415e972bf 100644 --- a/src/shared/mkfs-util.c +++ b/src/shared/mkfs-util.c @@ -4,6 +4,7 @@ #include #include +#include "escape.h" #include "log.h" #include "mkfs-util.h" #include "mount-util.h" @@ -154,6 +155,11 @@ static int mtools_exec(char *const *argv) { assert(argv); assert(argv[0]); + if (DEBUG_LOGGING) { + _cleanup_free_ char *j = quote_command_line(argv, SHELL_ESCAPE_EMPTY); + log_debug("Invoking mtools command: %s", strna(j)); + } + r = pidref_safe_fork( "(mtools)", FORK_RESET_SIGNALS|FORK_RLIMIT_NOFILE_SAFE|FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_WAIT|FORK_STDOUT_TO_STDERR|FORK_CLOSE_ALL_FDS, @@ -635,9 +641,7 @@ int make_filesystem( log_info("Formatting %s as %s", node, fstype); if (DEBUG_LOGGING) { - _cleanup_free_ char *j = NULL; - - j = strv_join(argv, " "); + _cleanup_free_ char *j = quote_command_line(argv, SHELL_ESCAPE_EMPTY); log_debug("Executing mkfs command: %s", strna(j)); }