Page MenuHomePhabricator

D9348.diff
No OneTemporary

D9348.diff

diff --git a/src/future/exec/ExecFuture.php b/src/future/exec/ExecFuture.php
--- a/src/future/exec/ExecFuture.php
+++ b/src/future/exec/ExecFuture.php
@@ -624,6 +624,18 @@
$pipes = array();
+ if (phutil_is_windows()) {
+ // See T4395. proc_open under Windows uses "cmd /C [cmd]", which will
+ // strip the first and last quote when there aren't exactly two quotes
+ // (and some other conditions as well). This results in a command that
+ // looks like `command" "path to my file" "something someting` which is
+ // clearly wrong. By surrounding the command string with quotes we can
+ // be sure this process is harmless.
+ if (strpos($unmasked_command, '"') !== false) {
+ $unmasked_command = '"'.$unmasked_command.'"';
+ }
+ }
+
// NOTE: See note above about Phage.
if (class_exists('PhutilErrorTrap')) {
$trap = new PhutilErrorTrap();

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 5:12 AM (3 w, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6274790
Default Alt Text
D9348.diff (949 B)

Event Timeline