diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-03-28 09:36:59 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-03-28 09:36:59 +0100 |
commit | abd8f9deca7bfd32337bd2a2f725647dd8a49a5e (patch) | |
tree | a2ffd381c27accbdfec25c5874429f936f88cbb2 | |
parent | 8aebb4fcefd068ecd78e1e586d72a782690038e5 (diff) | |
download | mdbp-abd8f9deca7bfd32337bd2a2f725647dd8a49a5e.tar.gz |
ssh runs the command through a shell, so we better quote stuff.
-rw-r--r-- | mdbp/ssh.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mdbp/ssh.py b/mdbp/ssh.py index 9e9ed8c..4572a6f 100644 --- a/mdbp/ssh.py +++ b/mdbp/ssh.py @@ -9,6 +9,7 @@ import json import pathlib import random import re +import shlex import subprocess import sys import tarfile @@ -116,7 +117,9 @@ def main() -> None: map(repoforward.proxy, build["extrarepositories"]) ) cmd.extend(repoforward.ssh_options()) - cmd.extend([args.host, "mdbp-streamapi", *args.command]) + cmd.append(args.host) + cmd.append("mdbp-streamapi") + cmd.extend(map(shlex.quote, args.command)) with contextlib.ExitStack() as stack: proc = stack.enter_context( subprocess.Popen( |