dotnet/msbuild

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

Open

#399 建立於 2015年12月10日

在 GitHub 查看
 (6 留言) (3 反應) (0 負責人)C# (1,364 fork)batch import
help wantedneeds-designtriaged

倉庫指標

Star
 (5,062 star)
PR 合併指標
 (平均合併 11天 7小時) (30 天內合併 125 個 PR)

描述

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.

貢獻者指南