26 Commits

Author SHA1 Message Date
Fabien Potencier
a9c4dfbf65 fixed CS 2019-04-08 18:15:54 +02:00
Florian Morello
1b6958b96b Fix missing $extraDirs when open_basedir returns 2019-04-08 18:14:48 +02:00
Fabien Potencier
4b32d21703 switched array() to [] 2019-01-16 10:39:14 +01:00
Andreas Möller
0d41dd7d95 Fix: Adjust DocBlock 2019-01-02 22:24:08 +01:00
Andreas Möller
bcbb0ec80e Fix: Method can also return null 2018-12-27 19:08:15 +01:00
Nicolas Grekas
cc83afdb5a Enable native_constant_invocation CS fixer 2018-07-26 13:13:39 +02:00
Alexey Kopytko
0b79e6d3b3 [Process] Consider \"executable\" suffixes first on Windows 2018-05-27 09:40:41 +02:00
Nicolas Grekas
df9e3c66fb bug #27141 [Process] Suppress warnings when open_basedir is non-empty (cbj4074)
This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Suppress warnings when open_basedir is non-empty

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

If PHP is configured *with a non-empty open_basedir* value that does not permit access to the target location, these calls to is_executable() throw warnings.

While Symfony may not raise exceptions for warnings in production environments, other frameworks (such as Laravel) do, in which case any of these checks causes a show-stopping 500 error.

We fixed a similar issue in the ExecutableFinder class via symfony/symfony#16182 .

This has always been an issue, but 709e15e7a3 made it more likely that a warning is triggered.

Commits
-------

34f136e01b Suppress warnings when open_basedir is non-empty
2018-05-15 10:20:41 +02:00
Nicolas Grekas
7f3634640b [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
Bilge
9b244e5771 Permit empty suffix on Windows 2017-02-16 04:33:37 -08:00
Christian Flothmann
e134ba500a silent file operation to avoid open basedir issues
Using file operations on a symlink that points to a file outside the
directories being allowed by the open_basedir setting leads to PHP
warnings being raised.
2016-09-28 19:20:21 -07:00
Ben Johnson
df000f3249 Workaround another buggy PHP warning
Added error-suppression to the `is_executable($path)` call, too, per the bug noted just above.

The cited issue manifests as such without it:

```
ErrorException in ExecutableFinder.php line 63:
is_executable(): open_basedir restriction in effect. File(/usr/share/php) is not within the allowed path(s): (/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/usr/local/zend/var/zray/extensions:/usr/local/zend/share:/usr/local/zend/var/plugins)
```
2016-08-04 13:11:16 -04:00
Ben
5571a0cc72 [Process] Workaround buggy PHP warning 2015-10-09 23:59:27 +02:00
Christian Flothmann
b6180398b4 use value of DIRECTORY_SEPARATOR to detect Windows
This commit unifies the detection of Windows builds across the Symfony
codebase.
2014-12-30 12:17:23 +01:00
Ben
cf09eaf9a0 [Process] Fixes issue #11421 2014-07-19 17:29:08 -06:00
Chris Smith
dbbf4556fc [Process] Fix ExecutableFinder with open basedir 2014-06-28 11:33:24 +02:00
Joseph Bielawski
fa405bdcf3 [Process] Fix docblocks, remove return from PhpProcess#start() as parent returns nothing, cleaned up ExecutableFinder 2013-01-12 13:49:05 +01:00
Jordi Boggiano
9c35e1ebda [Process] Clean-up/simplify code 2012-07-03 18:58:27 +02:00
Jordi Boggiano
0995610ef0 [Process] Add extra dirs argument to the executable finder to allow searching more dirs 2012-07-03 18:19:03 +02:00
Johannes M. Schmitt
d7d1f1d51b [Process] workaround a faulty implementation of is_executable on Windows 2011-09-15 19:42:58 +02:00
Florin Patan
a6acc9ac44 fixed CS and unsude variable (PR #1319) 2011-06-14 14:05:40 -04:00
Florin Patan
b9cbac85da Executable Finder will now try to match if a file is already in the open_basedir list before searching it thru that list 2011-06-14 13:36:01 -04:00
Florin Patan
4b26e904fd Fix problem with searching files while the open_basedir is in use 2011-05-23 12:54:22 +00:00
Kris Wallsmith
4dd76c6bd9 [Process] added optional argument for default executable 2011-04-26 07:45:16 -07:00
Fabien Potencier
864deab95b [Process] changed ExecutableFinder to return false instead of throwing an exception when the executable is not found
I've made the change as the executable goal is to find the executable. The fact that it does not find it is
part of the contract and it is not exceptional.
2011-04-26 15:18:24 +02:00
Johannes M. Schmitt
d1dcdfa95f [Process][Assetic] refactored some code to allow for better executable defaults 2011-04-08 12:20:27 +02:00