From a66b09cf1e6e738e106bca2fa8571a544640db8d Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Wed, 7 Aug 2024 07:19:25 +0200 Subject: [PATCH] shlex quote the working directory Co-authored-by: Nicola Soranzo --- lib/galaxy/tool_util/deps/singularity_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tool_util/deps/singularity_util.py b/lib/galaxy/tool_util/deps/singularity_util.py index 2d090fc6237c..081c706fc3c4 100644 --- a/lib/galaxy/tool_util/deps/singularity_util.py +++ b/lib/galaxy/tool_util/deps/singularity_util.py @@ -102,7 +102,7 @@ def build_singularity_run_command( # the mounting behavior. command_parts.append("--contain") if working_directory: - command_parts.extend(["--pwd", working_directory]) + command_parts.extend(["--pwd", shlex.quote(working_directory)]) if cleanenv: command_parts.append("--cleanenv") if ipc: