fgets workaround?

Having trouble installing serendipity?
Post Reply
juergen
Regular
Posts: 55
Joined: Tue Jul 04, 2006 2:23 pm
Location: Mayence, Germany
Contact:

fgets workaround?

Post by juergen »

Hi,

I'm currently installing serendipity v1.1. at the webserver of my university, like I've done at several ISPs well. But this admin has disabled fgets for security reasons. By this reason the installation fails with looped warnings "fgets has been disabled for security reasons" from include/functions_installer.inc.php line 1123

So far as I can see fgets is used at least in /Net/Socket.php, /Onyx/RSS.php and Smarty/libs/plugins/function.fetch.php too.

Do you have some arguments for a little discussion with the administrator? Or is it possible to implement a bypass for running the installation successfully?

Thx, Juergen
mastaYoda
Regular
Posts: 18
Joined: Wed Feb 08, 2006 12:13 pm
Contact:

file_get_contents(), fgetc()

Post by mastaYoda »

Hopefully your sysadmin does not know everything about PHP so maybe he left fgetc() or file_get_contents() enabled.

Example for fgetc():

Code: Select all

$resource = fopen(__FILE__, 'r');
$string = '';
while (!feof($resource))
    $string .= fgetc($resource);
Example for file_get_contents():

Code: Select all

$string = file_get_contents(__FILE__);
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: file_get_contents(), fgetc()

Post by garvinhicking »

Hi!

With disabled fgets, I'm afraid you won't be able to use many portions of Serendipity. You should not bother with it altogether, there are too many places where fgets is required.

Disabling it is like locking the door to your closet to prevent it from getting dirty. :)

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/
juergen
Regular
Posts: 55
Joined: Tue Jul 04, 2006 2:23 pm
Location: Mayence, Germany
Contact:

Re: file_get_contents(), fgetc()

Post by juergen »

garvinhicking wrote: Disabling it is like locking the door to your closet to prevent it from getting dirty. :)
I'm agree with you.
The sysadmin means, fgets() runs with webserver uid and all files (with passwords and so on) are readable using a simple script. Locking the door was the easiest way for him to prevent this.

I'll looking for another server...

Juergen
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: file_get_contents(), fgetc()

Post by garvinhicking »

Hi!

Definintely. There are other means of jailing users installations (fastCGI, suPHP, ...). Locking write access prevents most of the PHP applications to work at all...

HTH,
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/
Post Reply