Page 1 of 1

weird secure mode problem

Posted: Tue Feb 20, 2007 8:29 am
by dArignac
Hi there,

I've got an error with smarty on my server running serendipity 1.1 on php 5.0.4 in safe_mode.
It tells me
Fatal error: Smarty error: [in file: entries.tpl line 31]: [plugin] (secure mode) modifier 'escape' is not allowed (core.load_plugins.php, line 118) in ...Smarty.class.php on line 1095
The weird thing is that I did not enable the secure mode of smarty... even if I do

Code: Select all

var $security = true;

var $security_settings = array(
'PHP_HANDLING' => false,
'IF_FUNCS' => array('array', 'list',
'isset', 'empty',
'count', 'sizeof',
'in_array', 'is_array',
'true', 'false', 'null'),
'INCLUDE_ANY' => false,
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('escape'),
'ALLOW_CONSTANTS' => false
); 
the error is still the same akthough I allowed the escape function.
My server was PHP4 before and was now changed to PHP 5 with safe mode on, before this it worked fine. I was also running seredipity on another server with php 5 but safe mode off and everything was also fine.

So, where can I find a solution for this? Looks like smarty is reconfigured by something within serendipity, huh?

Thanks in advance!

Re: weird secure mode problem

Posted: Tue Feb 20, 2007 11:48 am
by garvinhicking
Hi!

That smarty error can also happen if it cannot find the Smarty files in your bundled-libs directory. This can be related to the new SafeMode functionality, and if the permissions on the smarty directory are mismatching.

Also it might be that Smarty is centrally installed somewhere on your server, instead of using the local s9y Smarty paths. You can control that behaviour by editing the serendipity_config.inc.php file and setting $serendipity['use_PEAR'] = false to only use Smarty bundled with s9y?

Best regards,
Garvin

Posted: Tue Feb 20, 2007 11:58 am
by dArignac
Which permissions should the smarty directory have?
Ich changed that PEAR option without any effect :(

Posted: Tue Feb 20, 2007 12:01 pm
by garvinhicking
Hi!
dArignac wrote:Which permissions should the smarty directory have?
It should have read and execute permissions for the webserver user for all (sub)directories, and read permission for all files...

Can you temporarily disable SafeMode? Or have a look at the server/php errorlogs?

Best regards,
Garvin

Posted: Tue Feb 20, 2007 12:11 pm
by dArignac
Permission are set like you said now - no change.
I completly deleted and reinstalled Serendipity... the same error still there.
Unfortunatly I can't disable SafeMode, for the logs I have to wait some time till the admin sends them to me...

Posted: Tue Feb 20, 2007 12:14 pm
by garvinhicking
Hi!

Hm. And you didn't change anything in your s9y configuration since it last worked, right?

The smarty error can sometimes be caused if the Path settings in s9y configuration are wrong. Did your provider move around/rename directories maybe?

Did you check that all files in the smarty directory that are present in the release tarball are there?

Best regards,
Garvin

Posted: Tue Feb 20, 2007 12:19 pm
by dArignac
Hi, I just downloaded it completly new and installed i completly new, and everything is within, so there shouldn't be any missing files.
Furthermore s9y itself got the path for the installation and set it, and of cause the path is right. I can check that in the backend and in the configuration database table. But the error is still there, narf...

Posted: Tue Feb 20, 2007 12:20 pm
by garvinhicking
Hi!

I could offer you to have a look at that strange installation, if you can give me temporary FTP acccess?

(IF so, please PM me)

Best regards,
Garvin

Posted: Tue Feb 20, 2007 12:35 pm
by dArignac
Hm, I'm sorry but I can't create another ftp user.
So I'll continue searching...

Posted: Tue Feb 20, 2007 12:55 pm
by garvinhicking
Hi!

Okay, no problem. Then your provider might need to help and inspect the safe mode enforced read/path privileges. :)

Best regards,
Garvin

Posted: Thu Feb 22, 2007 1:05 pm
by garvinhicking
Hi!

I found the problem: on dArignacs installation, the 'set_include_path' function returned "TRUE", but was not able to set the required include_path statements that Serendipity needs.

Thus, on his installation a locally installed Smarty in /usr/share/PHP5 was installed, but there no read privileges existed.

So even though this is a server misconfiguration problem (the local smarty has different ownership information, so it should not be included in the include_path PHP setting after all!) I have created a patch for the upcoming s9y versions:

http://svn.berlios.de/viewcvs/serendipi ... 02&r2=1628

That seems to work on the install you gave me access to :)

Best regards,
Garvin

Posted: Thu Feb 22, 2007 1:20 pm
by dArignac
Thanks a lot. I'll see if it works for my other installation...