Fix chmod() calls to apply umask
This commit is contained in:
parent
13c07d1469
commit
5c059aa121
@ -181,7 +181,7 @@ class ClassCollectionLoader
|
||||
{
|
||||
$tmpFile = tempnam(dirname($file), basename($file));
|
||||
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
|
||||
chmod($file, 0777);
|
||||
chmod($file, 0666 ^ umask());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ class ConfigCache
|
||||
|
||||
$tmpFile = tempnam(dirname($this->file), basename($this->file));
|
||||
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $this->file)) {
|
||||
chmod($this->file, 0666);
|
||||
chmod($this->file, 0666 ^ umask());
|
||||
} else {
|
||||
throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $this->file));
|
||||
}
|
||||
@ -110,7 +110,7 @@ class ConfigCache
|
||||
$file = $this->file.'.meta';
|
||||
$tmpFile = tempnam(dirname($file), basename($file));
|
||||
if (false !== @file_put_contents($tmpFile, serialize($metadata)) && @rename($tmpFile, $file)) {
|
||||
chmod($file, 0666);
|
||||
chmod($file, 0666 ^ umask());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ class File extends \SplFileInfo
|
||||
throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message'])));
|
||||
}
|
||||
|
||||
chmod($target, 0666);
|
||||
chmod($target, 0666 ^ umask());
|
||||
|
||||
return new File($target);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ abstract class CacheWarmer implements CacheWarmerInterface
|
||||
{
|
||||
$tmpFile = tempnam(dirname($file), basename($file));
|
||||
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
|
||||
chmod($file, 0644);
|
||||
chmod($file, 0666 ^ umask());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ class Store implements StoreInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
chmod($path, 0644);
|
||||
chmod($path, 0666 ^ umask());
|
||||
}
|
||||
|
||||
public function getPath($key)
|
||||
|
Reference in New Issue
Block a user