[Process] Also check PATH
in ExecutableFinder
if open_basedir
is set
#57954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current version of the
ExecutableFinder
only checks the paths in theopen_basedir
when set. However, this will cause theExecutableFinder
not find the executable in question if it is in a subfolder of one of theopen_basedir
paths.For example the environment might be configured as follows:
PATH=/usr/bin
open_basedir=/usr
In this case the
ExecutableFinder
only checks the/usr
folder and won't find the binaries in/usr/bin
, even though the PHP process would be allowed to access/usr/bin
, as theopen_basedir
restriction allows access to subfolders.This PR fixes that by always adding the paths from
PATH
to the directories to be checked.Note: this is not an issue in Symfony 6.4+. The
open_basedir
logic does not exist there and thus that problem does not exist there.