Skip to content

Commit

Permalink
Windows: Escaped command line arguments in subprocess.
Browse files Browse the repository at this point in the history
The command line for the containerizer has the command encoded
as JSON. Non escaped quotes are removed during the containerizer
startup and the JSON processed is invalid.

Review: https://reviews.apache.org/r/47486/
  • Loading branch information
dpravat authored and jmlvanre committed May 31, 2016
1 parent ad3e161 commit 7737edf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 3rdparty/libprocess/include/process/windows/subprocess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ inline Try<PROCESS_INFORMATION> createChildProcess(
// to have been already quoted correctly before we generate `command`.
// Incorrectly-quoted command arguments will probably lead the child process
// to terminate with an error. See also NOTE on `process::subprocess`.
const string command = strings::join(" ", argv);
string command = strings::join(" ", argv);

// Escape the quotes in `command`.
//
// TODO(dpravat): Add tests cases that cover this functionality. See
// MESOS-5418.
command = strings::replace(command, "\"", "\\\"");

// NOTE: If Mesos is built against the ANSI version of this function, the
// environment is limited to 32,767 characters. See[1].
Expand Down

0 comments on commit 7737edf

Please sign in to comment.