-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Removed cache backend option which explicitly set file permissions #14361
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
Removed cache backend option which explicitly set file permissions #14361
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+
orlangur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @xtremeperf! Glad to see this issue finally investigated and fixed, it was reported a bunch of times.
|
Hi @orlangur, thank you for the review. |
|
@xtremeperf thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
|
@magento-engcom-team give me new test instance |
|
Hi @okorshenko, here is your new test Magento instance |
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