]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus-execute: always normalize argv[0] to "sh" on EXEC_COMMAND_VIA_SHELL
authorMike Yuan <me@yhndnzj.com>
Mon, 12 May 2025 15:07:47 +0000 (17:07 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 12 May 2025 15:09:08 +0000 (17:09 +0200)
Addresses https://github.com/systemd/systemd/pull/37071#discussion_r2084851759

src/core/dbus-execute.c

index f7b2932e07aa36ed67242e3c185742eaf09793b5..d0281cc236d29efba3d36863170745caa85819af 100644 (file)
@@ -1551,7 +1551,7 @@ int bus_set_transient_exec_command(
                         path = _PATH_BSHELL;
 
                         if (strv_isempty(argv))
-                                r = strv_extend(&argv, path);
+                                r = strv_extend(&argv, "sh");
                         else
                                 r = free_and_strdup(&argv[0], argv[0][0] == '-' ? "-sh" : "sh");
                         if (r < 0)