[libcxx-commits] [PATCH] D99242: [libcxx] [test] Quote env variables that are set with a shell "export" in ssh.py

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 24 11:48:49 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/utils/ssh.py:111
         if args.env:
-            remoteCommands.append('export {}'.format(' '.join(args.env)))
+            remoteCommands.append('export {}'.format(pipes.quote(' '.join(args.env))))
         remoteCommands.append(subprocess.list2cmdline(commandLine))
----------------
`pipes.quote` is gone and/or undocumented in Python 3; the Internet tells me to use `shlex.quote` instead.

I'm skeptical of "shell escaping" cleanups because it's essentially impossible to do right, and so any //given// commit is likely to make matters more complicated without making them any more correct. I'd like the commit message to contain a concrete example of something that didn't work before, that does work now.
(I'm guessing this has to do with a `PATH` containing names-with-spaces; but I want the commit message to tell me explicitly.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99242/new/

https://reviews.llvm.org/D99242



More information about the libcxx-commits mailing list