Skip to content
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

Allow chmod failures on cache write #4522

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Apr 6, 2021

Description
Cache's FileHandler will attempt to se the file mode after writes using chmod(). This is already allowed to fail (i.e. return false) since files can be writable but not owned, however some circumstances can actually cause a fatal error:

chmod(): Operation not permitted
at SYSTEMPATH/Cache/Handlers/FileHandler.php:127

Backtrace:
  1    [internal function]
       CodeIgniter\Debug\Exceptions()->errorHandler()

  2    SYSTEMPATH/Cache/Handlers/FileHandler.php:127
       chmod()

This PR catches any throwable and log and ignores the exception.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • n/a User guide updated
  • Conforms to style guide

@MGatner MGatner merged commit 4e7f074 into codeigniter4:develop Apr 6, 2021
@MGatner MGatner deleted the chmod-crash branch April 6, 2021 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants