unlink and chmod() warnings in is_really_writable() for >100 connections per second |
|||
|---|---|---|---|
| Date: | 10/16/2008 | Severity: | Trivial |
| Status: | Resolved | Reporter: | Andriy Sylka |
| Version: | 1.6.3 | ||
| Keywords: | Libraries | ||
Description
Sometimes We have unlink or chmode warnings like
unlink(/var/www/system/cache/98dce83da57b0395e163467c9dae521b) in backend width >100 connections per second.
Probably it is colling md5(rand(1,100)).
Disabling checking is_really_writable() resolve this problem.
Add to config/config.php
$config[‘is_realy_writebale_enable’] = false;
Code Sample
function is_really_writable($file)
{
if (!config_item('is_realy_writebale_enable'))
return true;
if (is_dir($file))
{
$file = rtrim($file, '/').'/'.md5(rand(1,100));
if (($fp = @fopen($file, 'ab')) === FALSE)
{
return FALSE;
}
fclose($fp);
@chmod($file, 0777);
@unlink($file);
return TRUE;
}
elseif (($fp = @fopen($file, 'ab')) === FALSE)
{
return FALSE;
}
fclose($fp);
return TRUE;
}
Expected Result
Actual Result
Comment on Bug Report
| Posted by: Rick Ellis on 22 October 2008 2:40pm | |
|
|
I assume you’re on a unix server? If so, I added some code to that function which should take care of the problem. |
| Posted by: Andriy Sylka on 24 October 2008 7:26am | |
|
|
Yes, it is Fedora 8. |
