weird secure mode problem

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
dArignac
Regular
Posts: 11
Joined: Tue Feb 20, 2007 8:23 am
Location: Germany

weird secure mode problem

Post 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!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: weird secure mode problem

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dArignac
Regular
Posts: 11
Joined: Tue Feb 20, 2007 8:23 am
Location: Germany

Post by dArignac »

Which permissions should the smarty directory have?
Ich changed that PEAR option without any effect :(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dArignac
Regular
Posts: 11
Joined: Tue Feb 20, 2007 8:23 am
Location: Germany

Post 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...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dArignac
Regular
Posts: 11
Joined: Tue Feb 20, 2007 8:23 am
Location: Germany

Post 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...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dArignac
Regular
Posts: 11
Joined: Tue Feb 20, 2007 8:23 am
Location: Germany

Post by dArignac »

Hm, I'm sorry but I can't create another ftp user.
So I'll continue searching...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dArignac
Regular
Posts: 11
Joined: Tue Feb 20, 2007 8:23 am
Location: Germany

Post by dArignac »

Thanks a lot. I'll see if it works for my other installation...
Post Reply