[8.x] Ensure cache directory permissions #39591
Merged
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.
There's an option to specify file permissions for the cache file store. But currently it only affects the files. All the prefix directories (e.g.
cache/data/0b/ee
) are created via Filesystem'smakeDirectory($path, 0777)
which ends up getting whatever umask implies, not what was specified in the config.The function to ensure the correct permissions was already there. I use it to check the permissions of parent dirs (e.g.
cache/data/0b
andcache/data/0b/ee
) as well. Ideally there would be a separate option for directory permissions and/or just use the Flysystem instead of Filesystem, but I wanted to keep the scope of this PR limited to the actual issue for now.This should resolve issues like #33770.