You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Mahler (Jira)" <ji...@apache.org> on 2020/04/02 00:05:00 UTC

[jira] [Commented] (MESOS-10093) Libprocess does not properly escape subprocess argument strings on Windows

    [ https://issues.apache.org/jira/browse/MESOS-10093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17073265#comment-17073265 ] 

Benjamin Mahler commented on MESOS-10093:
-----------------------------------------

Did some research and synced with [~greggomann] and [~asekretenko]. On windows processes can't actually receive an argument array and they're started using a full string command line; it's up to them to parse these command lines into arguments. Most programs use {{CommandLineToArgvW}}, especially those programs that are not windows only (e.g. some libc, java, or python program). However, cmd.exe *does not* use {{CommandLineToArgvW}} and therefore applying the quoting is not correct.

The fix will be to surface direct command line string utilities (windows only) alongside the argv style, and callers will have to choose when to use the command line string versions (e.g. if using cmd.exe).

We may need to do something special for docker style commands (e.g. "docker run ... <command>"), but not sure yet.

Some cleanup patches to prepare for a fix:

https://reviews.apache.org/r/72273/
https://reviews.apache.org/r/72285/
https://reviews.apache.org/r/72286/
https://reviews.apache.org/r/72303/
https://reviews.apache.org/r/72304/

> Libprocess does not properly escape subprocess argument strings on Windows
> --------------------------------------------------------------------------
>
>                 Key: MESOS-10093
>                 URL: https://issues.apache.org/jira/browse/MESOS-10093
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 1.9.0
>            Reporter: Greg Mann
>            Assignee: Benjamin Mahler
>            Priority: Major
>              Labels: containerization, docker, mesosphere, windows
>
> When running some tests of Mesos on Windows, I discovered that the following command would not execute successfully when passed to the Docker containerizer in {{TaskInfo.command}}:
> {noformat}
> python -c "print('hello world')"
> {noformat}
> The following error is found in the task sandbox:
> {noformat}
>   File "<string>", line 1
>     "print('hello
>                 ^
> SyntaxError: EOL while scanning string literal
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)