diff --git a/kernelci/storage/ssh.py b/kernelci/storage/ssh.py index 2d2726c10a..636f54f3ea 100644 --- a/kernelci/storage/ssh.py +++ b/kernelci/storage/ssh.py @@ -7,6 +7,7 @@ """KernelCI storage implementation for SSH""" import os +import shlex from paramiko import SSHClient, client from scp import SCPClient @@ -44,7 +45,7 @@ def _upload(self, file_paths, dest_path): for src, dst in file_paths: dst_file = os.path.join(self.config.path, dest_path, dst) dst_dir = os.path.dirname(dst_file) - self._ssh.exec_command(f"mkdir -p {dst_dir}") + self._ssh.exec_command(f"mkdir -p {shlex.quote(dst_dir)}") self._scp.put(src, dst_file)