safe_mode of PHP in Perl

Discussion in 'Perl Misc' started by hakim, Mar 5, 2006.

  1. hakim

    hakim Guest

    Hello,

    I am running a webserver. I offer PHP in safe_mode, that means:

    When safe_mode is on, PHP checks to see if the owner of the current
    script matches the owner of the file to be operated on by a file
    function or its directory. For example:

    -rw-rw-r-- 1 rasmus rasmus 33 Jul 1 19:20 script.php
    -rw-r--r-- 1 root root 1116 May 26 18:01 /etc/passwd

    Running this script.php
    <?php
    readfile('/etc/passwd');
    ?>
    results in this error when safe mode is enabled:

    Warning: SAFE MODE Restriction in effect. The script whose uid is 500
    is not
    allowed to access /etc/passwd owned by uid 0 in /docroot/script.php on
    line 2


    Is there a similar way to configure perl or mod_perl. I would like to
    offer Perl to my customers to run their own CGI-Scripts, if they want.
    I don't want them to read files others then their own homedirectory.

    Thanks a lot...

    Achim
     
    hakim, Mar 5, 2006
    #1
    1. Advertising

  2. "hakim" <> wrote in news:1141576408.896833.86720
    @u72g2000cwu.googlegroups.com:

    > I am running a webserver. I offer PHP in safe_mode, that means:


    ....

    > Is there a similar way to configure perl or mod_perl.


    I found the following discussion interesting and informative:

    http://gallery.menalto.com/node/3017

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Mar 5, 2006
    #2
    1. Advertising

  3. hakim wrote:
    > I am running a webserver. I offer PHP in safe_mode, ...
    >
    > Is there a similar way to configure perl or mod_perl. I would like to
    > offer Perl to my customers to run their own CGI-Scripts, if they want.
    > I don't want them to read files others then their own homedirectory.


    suEXEC would at least prevent them from reading files that aren't world
    readable.

    http://httpd.apache.org/docs/2.0/suexec.html

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Mar 5, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ted Zeng
    Replies:
    4
    Views:
    543
    Tim Arnold
    Oct 3, 2006
  2. Ted Zeng
    Replies:
    0
    Views:
    659
    Ted Zeng
    Oct 13, 2006
  3. Rajive Narain
    Replies:
    0
    Views:
    1,988
    Rajive Narain
    Sep 18, 2009
  4. Ignoramus6539
    Replies:
    2
    Views:
    231
    Colin McKinnon
    Aug 30, 2006
  5. M. Strobel
    Replies:
    1
    Views:
    228
    The Natural Philosopher
    Mar 5, 2013
Loading...

Share This Page