Fix #70362: Can't copy() large 'data://' with open_basedir#5237
Closed
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Closed
Fix #70362: Can't copy() large 'data://' with open_basedir#5237cmb69 wants to merge 1 commit intophp:PHP-7.3from
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Conversation
open_basedir is only relevant for plain files, so there is no need to check it for other URL wrappers.
nikic
reviewed
Mar 5, 2020
| ZEND_PARSE_PARAMETERS_END(); | ||
|
|
||
| if (php_check_open_basedir(source)) { | ||
| if (php_stream_locate_url_wrapper(source, NULL, 0) == &php_plain_files_wrapper && php_check_open_basedir(source)) { |
Member
There was a problem hiding this comment.
If that's the case, shouldn't it be part of php_check_open_basedir itself?
Member
Author
There was a problem hiding this comment.
Somehow that would be better, but it seems that a lot of related code assumes otherwise, and I'm not sure about the performance impact.
Member
Author
There was a problem hiding this comment.
Bad wording, sorry! I mean that some code already checks whether a plain_files_wrapper is given, and only then calls php_check_open_basedir(), e.g.
php-src/ext/standard/filestat.c
Line 778 in 1bc56db
Member
Author
There was a problem hiding this comment.
@nikic, any suggestions on how to proceed here?
nikic
approved these changes
Jun 29, 2020
Member
Author
|
Thanks! Applied as 7f3bc64. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
open_basedir is only relevant for plain files, so there is no need to
check it for other URL wrappers.