Removed cache backend option which explicitly set file permissions#14361
Merged
magento-engcom-team merged 1 commit intoMar 27, 2018
Conversation
- Removed hashed_directory_umask option because it caused Cm_Cache_Backend_File class to explicitly set permissions using chmod, ignoring umask and setgid bit. - Zend_Cache_Backend_File class deprecated and removed hashed_directory_umask option from Zend Framework v1.12+ - Magento Framework does not explicitly set file & directory permissions as of v2.0.6+
Contributor
orlangur
approved these changes
Mar 26, 2018
orlangur
left a comment
Contributor
There was a problem hiding this comment.
Nice @xtremeperf! Glad to see this issue finally investigated and fixed, it was reported a bunch of times.
Contributor
|
Hi @orlangur, thank you for the review. |
Contributor
|
@xtremeperf thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Contributor
|
@magento-engcom-team give me new test instance |
Contributor
|
Hi @okorshenko, here is your new test Magento instance |
This was referenced Mar 27, 2018
magento-engcom-team
pushed a commit
that referenced
this pull request
Mar 27, 2018
This was referenced Mar 28, 2018
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.
Description
This fix will allow the Magento Framework to no longer explicitly set file/directory permissions from the default cache backend by removing use of the hashed_directory_umask option
'hashed_directory_umask' => 0777,from code within the file
lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php.This option was deprecated and removed from the Zend Framework as of version 1.12, but has remained in the Magento Framework.
Cm_Cache_Backend_File class still supports "hashed_directory_umask" option, with additional class code providing backwards compatibility with ZF 1.11.
However, setting this option was causing Cm_Cache_Backend_File to use PHP's chmod function recursively on the hashed directory structure during file and directory creation. Simply removing this option allows permissions to be inherited properly from the file system, and respects SETGID bit and Magento umask.
Fixed Issues (if relevant)
Manual testing scenarios
var/cacheandvar/page_cacheand upContribution checklist