Skip to content

Commit

Permalink
Set umask when creating cache file
Browse files Browse the repository at this point in the history
Fixes #2080
  • Loading branch information
0x20h authored and markstory committed Oct 12, 2011
1 parent 6fe24a4 commit b4e3c8a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cake/libs/cache/file.php
Expand Up @@ -138,9 +138,12 @@ function write($key, &$data, $duration) {

$expires = time() + $duration;
$contents = $expires . $lineBreak . $data . $lineBreak;
$old = umask(0);
$handle = fopen($this->_File->path, 'a');
umask($old);

if (!$handle = fopen($this->_File->path, 'a')) {
return false;
if (!$handle) {
return false;
}

if ($this->settings['lock']) {
Expand Down

0 comments on commit b4e3c8a

Please sign in to comment.