FileSystemCache permissions issue
Pi-George opened this issue · 1 comments
FileCache even with a umask parameter provided of 0 is creating directories and files with permissions 0755 instead of 0666 or 0777. This seems to be because by default PHP umask is 0022 which effects the mkdir command https://www.php.net/manual/en/function.mkdir.php https://www.php.net/manual/en/function.umask.php
To reproduce simply use
new FilesystemCache(
APPLICATION_ROOT . '/var/cache/awscredsprovider',
FilesystemCache::EXTENSION,
0
);
And as a result the directory created:
root@ip-10-0-1-186:/srv/www# ls -la var/cache/
total 32
drwxrwxrwx 7 root root 4096 Jun 8 15:56 .
drwxrwxrwx 1 root root 4096 Jun 8 15:20 ..
drwxr-xr-x 2 www-data www-data 4096 Jun 8 15:56 awscredsprovider
I'm not sure if this would be considered a bug or not since the systems umask is being used. However I'd consider that the paramter umask should take priority over the system variable since it's being explicitly provided, the current behavior is confusing since it's taking into account a default value that is essentially invisible. Ideally I think the systems umask() should be set to 0 during the usage of mkdir and restored to it's previous value after to allow for the parameter provided umask to work as expected.
2 things:
- This is the wrong repository. dcotrine/cache lives at https://github.com/doctrine/cache/
- doctrine/cache is being sunset, so this won't be changed. Please see doctrine/cache#354 for more details. So I'm closing this issue.