-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Windows, don't rely on the OS to find executables #12180
On Windows, don't rely on the OS to find executables #12180
Conversation
da7e9af
to
728106c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grepping for ProcessExecutor::escape
is the best way to see what remains of string command-lines after this PR:
ZipDownloader
: could be turned into array commandsUtil\Svn
: this one is rooted for string command-lines (execute(string $command, ...)
)EventDispatcher
: this class runs scripts only if allowed to so its safePerforce
:executeCommand
is document as@param non-empty-string $command
SvnDownloader
: because it usesUtil\Svn
These classes are nonetheless hardened thanks to the added logic in ProcessExecutor.
728106c
to
e1caf42
Compare
Symfony "generic" PR at symfony/symfony#58710 |
… does not reset URL between commands
cfa5be4
to
7578df9
Compare
944c76a
to
e641d60
Compare
69ceac3
to
a7fee29
Compare
995b37b
to
88c5f2d
Compare
…tables (nicolas-grekas) This PR was merged into the 7.2 branch. Discussion ---------- [Process] On Windows, don't rely on the OS to find executables | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Porting part of composer/composer#12180 here: On Windows, when searching for an executable, the OS always looks at the current directory before using the PATH variable. This makes it easier than desired to hijack executables. Unix-like OSes don't have this issue. This PR proposes to rely on ExecutableFinder instead. Commits ------- b35a7d4 [Process] On Windows, don't rely on the OS to find executables
…tables (nicolas-grekas) This PR was merged into the 7.2 branch. Discussion ---------- [Process] On Windows, don't rely on the OS to find executables | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Porting part of composer/composer#12180 here: On Windows, when searching for an executable, the OS always looks at the current directory before using the PATH variable. This makes it easier than desired to hijack executables. Unix-like OSes don't have this issue. This PR proposes to rely on ExecutableFinder instead. Commits ------- b35a7d42931 [Process] On Windows, don't rely on the OS to find executables
88c5f2d
to
6058e49
Compare
composer.lockPackage changes
Dev Package changes
Settings · Docs · Powered by Private Packagist |
Thanks! |
Thanks too! |
The composer.lock diff comment has been updated to reflect new changes in this PR. |
Windows always looks up in the current directory when searching for a binary.
This is risky practice, so this PR tries to prevent this by using ExecutableFinder instead (which looks up using the PATH only).
While at it, I replaced all string command lines by array commands. This removed the need for explicit argument escaping.
Some remain, but most are removed.