From d65b6edfaf5fa2593be85b46323c1f6a1544f552 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:50:58 +0200 Subject: [PATCH] [PR #10525/5bdd82fb backport][stable-11] composer: command args as list rather than string (#10590) composer: command args as list rather than string (#10525) * composer: command args as list rather than string * add changelog frag (cherry picked from commit 5bdd82fbf5190bffe9101b630275941ebc4bf09b) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/10525-composer-cmd-list.yml | 2 ++ plugins/modules/composer.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/10525-composer-cmd-list.yml diff --git a/changelogs/fragments/10525-composer-cmd-list.yml b/changelogs/fragments/10525-composer-cmd-list.yml new file mode 100644 index 0000000000..a2aebc8a6d --- /dev/null +++ b/changelogs/fragments/10525-composer-cmd-list.yml @@ -0,0 +1,2 @@ +minor_changes: + - composer - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10525). diff --git a/plugins/modules/composer.py b/plugins/modules/composer.py index 735b4d2d36..d932a5a060 100644 --- a/plugins/modules/composer.py +++ b/plugins/modules/composer.py @@ -188,7 +188,7 @@ def composer_command(module, command, arguments="", options=None): else: composer_path = module.params['composer_executable'] - cmd = "%s %s %s %s %s %s" % (php_path, composer_path, "global" if global_command else "", command, " ".join(options), arguments) + cmd = [php_path, composer_path, "global" if global_command else "", command] + options + [arguments] return module.run_command(cmd)