Freaking Error

Started by vaggos12, November 04, 2010, 08:12:21 AM

Previous topic - Next topic

vaggos12

i have this error in some mods for going to add
Database Error: Lost connection to MySQL server during query
File: /home/smasher/public_html/Sources/Load.php
Line: 2021
version 1.1.11

xenovanis

What mods do you have installed?

Are there any errors in your forum's errorlog?
"Insanity: doing the same thing over and over again and expecting different results."

vaggos12

 Today at 06:50:00 AM
94.69.12.185      114ffc123c707becf8b588daf4d62afa
http://freakingdevs.x10.mx/index.php?action=theme;sa=install [nofollow]
2: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: File exists
File: /home/smasher/public_html/Sources/Themes.php
Line: 998
   
HipzR    Today at 06:49:07 AM
94.69.12.185      114ffc123c707becf8b588daf4d62afa
http://freakingdevs.x10.mx/index.php?action=theme;sa=install [nofollow]
2: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: File exists
File: /home/smasher/public_html/Sources/Themes.php
Line: 998
   
HipzR    Today at 06:48:21 AM
94.69.12.185      114ffc123c707becf8b588daf4d62afa
http://freakingdevs.x10.mx/index.php?action=theme;sa=install [nofollow]
2: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: File exists
File: /home/smasher/public_html/Sources/Themes.php
Line: 998
   
HipzR    Today at 04:43:35 AM
94.69.12.185      114ffc123c707becf8b588daf4d62afa
http://freakingdevs.x10.mx/index.php?action=packageget;sa=upload [nofollow]
The file you are uploading already exists on the server. Please delete it first then try again.
   
HipzR    Today at 04:34:43 AM
94.69.12.185      114ffc123c707becf8b588daf4d62afa
http://freakingdevs.x10.mx/index.php?action=packages;sa=browse [nofollow]
Administration login attempt!
Referer: http://freakingdevs.x10.mx/index.php?action=packages;sa=browse [nofollow]
User agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7
IP: 94.69.12.185

xenovanis

So, when does this error happen? All the time or on a particular action?
"Insanity: doing the same thing over and over again and expecting different results."

MrPhil

I don't like the looks of the code where the error is occurring:
if (!empty($_REQUEST['copy']) && $method == 'copy')
{
// Hopefully the themes directory is writable, or we might have a problem.
if (!is_writable($boarddir . '/Themes'))
fatal_lang_error('theme_install_write_error');

$theme_dir = $boarddir . '/Themes/' . preg_replace('~[^A-Za-z0-9_\- ]~', '', $_REQUEST['copy']);

umask(0);
mkdir($theme_dir, 0777);   <<<< 998 in SMF 1.1.11

// Copy over the default non-theme files.


The line in question appears to be
mkdir($theme_dir, 0777);
It does not appear to be possible for $theme_dir to be empty, so I'll assume that it's just a feature of the error message that the directory being created is not given. is_writable() does not appear to have returned false, so presumably the Themes directory exists and is writable. Therefore, the problem is either that the given name is invalid in some way, or the hardcoded 777 permissions are causing problems. WAKE UP, DEVELOPERS! YOU CAN NOT FORCE 777 PERMISSIONS -- SOME SERVERS REFUSE IT! At the very least, make separate directory and file permission settings as default 0755 and 0644, in some central place, so the user has to change only one file and location! Perhaps Settings.php?

Depending on whether your server permits or requires 777 permissions for PHP (SMF) to write to a directory, you may need to try changing all hardcoded 0777 to 0755, especially if you know that your host does not permit "world writable" directories (e.g., is running suPHP). If that doesn't do it, or if you get error messages that the directory was created but is not writable (you're not running suPHP), we'll have to investigate further. If the directory actually does already exist, why is SMF trying to create it?  (.../Themes/<new theme>/) does exist, we need to see why SMF isn't checking that it already exists. As a quick workaround, if SMF is to create a new .../Themes/<new theme>/, you could manually erase that directory and all files in it, before attempting to install the new copy of the theme.

If a theme directory exists, SMF is evidently failing to check for that, and will try creating the directory. This is clearly a bug.

xenovanis

Thanks for the always appreciated input MrPhil :)

I don't have a copy of 1.1.12 at hand here. Are you able to see of this is still coded in 1.1.12?
"Insanity: doing the same thing over and over again and expecting different results."

MrPhil

Yeah, Sources/Themes.php appears to be unchanged from 1.1.11's version.

Advertisement: