2008-08-03, 08:12 AM
Pages: 1 2
2008-08-03, 11:27 AM
The avatar upload function uses the apache user/usergroup instead of the user/usergroup of the domain where the Forum is running, that's why the files become chmod 600.
EDIT: OK, i checked this with my own server configuration, and everything with the user/usergroup works fine.
EDIT: OK, i checked this with my own server configuration, and everything with the user/usergroup works fine.
2008-08-03, 11:52 AM
ah, and how can i fix that?
Because on other Forum Systems oder CMS i havent this problem, the Forum is on my server, same as the domain, you can check it @ replay-gaming.eu if ypu want to test it
Its a empty Forum, atm its more for testing
thx for yout help
Because on other Forum Systems oder CMS i havent this problem, the Forum is on my server, same as the domain, you can check it @ replay-gaming.eu if ypu want to test it
Its a empty Forum, atm its more for testing
thx for yout help
2008-08-03, 04:44 PM
OK, i found the problem
Open /inc/function_upload.php
Goto Line 558:
and change to
After this, all avatar that are uploaded have chmod 644.
Open /inc/function_upload.php
Goto Line 558:
@my_chmod($path."/".$filename, 0664);
and change to
@my_chmod($path."/".$filename, 0644);
After this, all avatar that are uploaded have chmod 644.
2008-08-03, 04:49 PM
Thank you for your bug report.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
2008-08-04, 05:58 AM
Why aren't you using the my_chmod function?
As far as I can see mybb use the chmod functionality only twice:
mybb_1400\Upload\inc\functions_image.php line #123 - @my_chmod($path."/".$filename, 0666);
mybb_1400\Upload\inc\functions_upload.php line #558 - @my_chmod($path."/".$filename, 0664);
and in both by the my_chmod function and not directly chmod.
//Custom chmod function to fix problems with hosts who's server configurations screw up umasks
// (quoted from mybb_1400\Upload\inc\functions.php line #5244)
@my_chmod($path."/".$filename, 0644);
As far as I can see mybb use the chmod functionality only twice:
mybb_1400\Upload\inc\functions_image.php line #123 - @my_chmod($path."/".$filename, 0666);
mybb_1400\Upload\inc\functions_upload.php line #558 - @my_chmod($path."/".$filename, 0664);
and in both by the my_chmod function and not directly chmod.
2008-08-04, 10:19 PM
The my_chmod function seems not to work for all apache/php configurations, because the uploaded files had chmod 600 and not 664. But the chmod function works perfect on my configuration.
2008-08-09, 02:44 AM
Some users in the german community reported that this fix isn't working. The problem is that the function my_chmod() always returns false.
Here's a little testscript:
Here's a little testscript:
<?php
function my_chmod($mode)
{
if(substr($mode, 0, 1) != '0' || strlen($mode) !== 4)
{
echo "Failure!";
}
else
{
echo "Success";
}
}
my_chmod(0644);
?>
It outputs "Failure". The problem is that substr() and strlen() only work with strings. If you set the argument inside quotation marks it returns "Success":my_chmod("0644");
2008-08-09, 06:09 AM
Double fixed.
@Chris might be the reason why it didn't work on your other work script
Try this michael
@Chris might be the reason why it didn't work on your other work script
Try this michael
function my_chmod($file, $mode)
{
if(substr((string)$mode, 0, 1) != '0' || strlen((string)$mode) !== 4)
{
return false;
}
$old_umask = umask(0);
$result = chmod($file, $mode);
umask($old_umask);
return $result;
}
2008-08-09, 04:21 PM
It's not working. I also inserted the line
$mode = (string)$mode;
at the beginning of the my_chmod function before and it didn't work.Pages: 1 2