dotnet/msbuild

Provide a method to execute an external command without using a shell

Open

#399 opened on 2015年12月10日

GitHub で見る
 (6 comments) (3 reactions) (0 assignees)C# (1,364 forks)batch import
help wantedneeds-designtriaged

Repository metrics

Stars
 (5,062 stars)
PR merge metrics
 (平均マージ 11d 7h) (30d で 125 merged PRs)

説明

The Exec task always spawns a shell to invoke the external command. This is convenient, but non-portable, insecure (though not exploitable here), and requires non-portable escaping.

A better solution is to provide a way to execute an external command without using a shell. It should have the following properties:

  • Lists are respected.
  • Any character can be passed to an external command. No manual escaping required.
  • Special characters in property values do not cause problems.
  • No shell is invoked, unless the external command is the shell.
  • It should be possible to pass multiple arguments to the shell
  • The syntax should be something other than requiring a seperate XML element per argument.

コントリビューターガイド