Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Process] Also checkPATH inExecutableFinder ifopen_basedir is set#57954
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedAug 12, 2024
Thanks for the nice explanations. |
fritzmg commentedAug 12, 2024
Unfortunately I am on Windows and execution of these tests are excluded on Windows 🙈. Thus I did not investigate how the tests would need to be adjusted 🤔 |
xabbuh commentedAug 14, 2024
I think a proper fix would be to instead use the configured open basedir to ignore the directories defined in |
fritzmg commentedAug 14, 2024
That's already the case with the current code. |
stof commentedAug 14, 2024
@fritzmg no. in your PR, you search in PATH even if it is outside the open_basedir restriction, because you don't filter the list |
fritzmg commentedAug 14, 2024
nicolas-grekas commentedSep 17, 2024
Closing in favor of#58291 |
…sedir (BlackbitDevs)This PR was merged into the 5.4 branch.Discussion----------[Process] Fix finding executables independently of open_basedir| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues | -| License | MITThis backports#47422 to 5.4, which is a bugfix really.Instead of#58008 and#57954 /cc `@xabbuh` `@fritzmg`Commits-------4424763 [Process] Fix finding executables independently of open_basedir
Uh oh!
There was an error while loading.Please reload this page.
The current version of the
ExecutableFinderonly checks the paths in theopen_basedirwhen set. However, this will cause theExecutableFindernot find the executable in question if it is in a subfolder of one of theopen_basedirpaths.For example the environment might be configured as follows:
PATH=/usr/binopen_basedir=/usrIn this case the
ExecutableFinderonly checks the/usrfolder and won't find the binaries in/usr/bin, even though the PHP process would be allowed to access/usr/bin, as theopen_basedirrestriction allows access to subfolders.This PR fixes that by always adding the paths from
PATHto the directories to be checked.Note: this is not an issue in Symfony 6.4+. The
open_basedirlogic does not exist there and thus that problem does not exist there.