]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkfs-util: let's debug log about all fork off cmdlines
authorLennart Poettering <lennart@amutable.com>
Wed, 1 Jul 2026 14:04:18 +0000 (16:04 +0200)
committerLennart Poettering <lennart@amutable.com>
Wed, 1 Jul 2026 14:10:39 +0000 (16:10 +0200)
src/shared/mkfs-util.c

index 80c509f99b010c5c2d2e5589bb8acee39b1c3d34..33415e972bffd1386adc4ee6e5b990ed66385dad 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/mount.h>
 #include <unistd.h>
 
+#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));
         }