Skip to content
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

Symfony\Component\VarDumper\Caster\LinkStub::getComposerRoot() will raise errors when open_basedir restrictions is set on the project root dir #23661

Closed
pounard opened this issue Jul 25, 2017 · 1 comment

Comments

@pounard
Copy link
Contributor

pounard commented Jul 25, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? not sure
RFC? no
Symfony version 3.3.x

I stumbed upon the same issue that #22149 but with this component, when the project root dir is under open_basedir restriction, this the LinkStub::getComposerRoot() will fail finding the composer.json file, under certain circumstances, depending on the PHP configuration and version, this may end up in a fatal error making it impossible to work with a 'dev' environment in such case.

Steps to reproduce:

  • enable open_basedir, exclude the project root dir from it, allow only app, public, src, vendor directories in open_basedir configuration;
  • manually clear all caches and attempt to access site with the debug bundle activated.

I have no clue on fixing this one, but it would be nice if it could use the project.root_dir variable instead, maybe by injecting it. Problem is, all usages are done in the component itself, it would need to inject the path in pretty much every class that uses it, which would make a patch very invasive, and would potentially make it a BC break.

@pounard pounard changed the title Get rid of Symfony\Component\VarDumper\Caster\LinkStub::getComposerRoot() Symfony\Component\VarDumper\Caster\LinkStub::getComposerRoot() will raise errors when open_basedir restrictions is set on the project root dir Jul 25, 2017
nicolas-grekas added a commit that referenced this issue Aug 16, 2017
…omposer.json (nicolas-grekas)

This PR was merged into the 3.3 branch.

Discussion
----------

[VarDumper] play nice with open_basedir when looking for composer.json

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

ping @pounard, can you please confirm this fixes the issue you reported?

Commits
-------

1bea774 [VarDumper] play nice with open_basedir when looking for composer.json
@pounard
Copy link
Contributor Author

pounard commented Aug 26, 2017

Hello, sorry for answering this late. I did not manage to reproduce the behavior I stumbled upon, at all, even with the unpatched Symfony, but this project is also a heavily moving target since it's pending development, so I guess someone else fixed it... From what I can read in the patch, it might not happen again thanks to this, so I assume it can closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants