]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlink: tweak exec_with_listen_fds() log generation 41283/head
authorMichael Vogt <michael@amutable.com>
Thu, 26 Mar 2026 15:32:48 +0000 (16:32 +0100)
committerMichael Vogt <michael@amutable.com>
Tue, 31 Mar 2026 16:25:09 +0000 (18:25 +0200)
The previous code used strv_join() when it generated the log
message for `varlinkctl --exec`. However this can lead to
inaccurate logging so use `quote_command_line()` instead.

Thanks to Lennart for suggesting this.

src/varlinkctl/varlinkctl.c

index 979797f8ecd48bcba66c2d5f1091d5e0941a2b8b..4495d090dfc0da4ca32bf9e4818e03e011b2a1e5 100644 (file)
@@ -12,6 +12,7 @@
 #include "bus-util.h"
 #include "chase.h"
 #include "env-util.h"
+#include "escape.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "format-table.h"
@@ -653,7 +654,7 @@ static int upgrade_forward_done(SocketForward *sf, int error, void *userdata) {
 _noreturn_ static void exec_with_listen_fds(char **exec_cmdline, int *fds, size_t n_fds) {
         int r;
 
-        _cleanup_free_ char *j = strv_join(exec_cmdline, " ");
+        _cleanup_free_ char *j = quote_command_line(exec_cmdline, SHELL_ESCAPE_EMPTY);
         if (!j) {
                 log_oom();
                 _exit(EXIT_FAILURE);