[libc++] Use proper shell escaping in the executors
Cr-Mirrored-From: https://chromium.googlesource.com/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: f8452ddfcc3336e42544a35481507f0b3bae423e
diff --git a/utils/ssh.py b/utils/ssh.py
index c7d8c97..f9bcabe 100644
--- a/utils/ssh.py
+++ b/utils/ssh.py
@@ -15,6 +15,7 @@
import argparse
import os
+import pipes
import posixpath
import subprocess
import sys
@@ -97,10 +98,11 @@
# host by transforming the path of test-executables to their path in the
# temporary directory, where we know they have been copied when we handled
# test dependencies above.
+ commandLine = (pathOnRemote(x) if isTestExe(x) else x for x in commandLine)
remoteCommands += [
'cd {}'.format(tmp),
'export {}'.format(' '.join(args.env)),
- ' '.join(pathOnRemote(x) if isTestExe(x) else x for x in commandLine)
+ ' '.join(pipes.quote(x) for x in commandLine)
]
# Finally, SSH to the remote host and execute all the commands.