From owner-freebsd-questions Wed Mar 20 0:46: 0 2002 Delivered-To: freebsd-questions@freebsd.org Received: from i-sp.com (mail.i-sp.com [194.163.14.12]) by hub.freebsd.org (Postfix) with SMTP id 2154037B41A for ; Wed, 20 Mar 2002 00:45:50 -0800 (PST) Received: (qmail 21151 invoked from network); 20 Mar 2002 08:38:53 -0000 Received: from proxy.i-sp.com (HELO ispxx) (194.163.14.99) by 194.163.14.12 with SMTP; 20 Mar 2002 08:38:53 -0000 From: "Roland Dworschak" To: Subject: RE: Limit PERL opening file in a directory / PHP Date: Wed, 20 Mar 2002 09:38:14 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I was just wondering if there's something like SuEXEC for PHP. I have a few virtual sites in my server. There is a security risk > that these users are able to open files that are not in his/her > directory by using PERL scripts because most of the system files > are set as everyone read. > > Now, I just made it work that the user can not open a file out > of his/her directory with PHP by adding php_admin_value open_basedir 'directory' > into apache configuration file. > > I want to implement the same limitation with PERL. > Also, I want to block some functions in PERL, such as system(). > > Is there any suggestion? Thank you. You shold better set propper permissions on files and directories. Apache's suExec is very handy if you need to restrict cgi script's permisions. chmod 750 /home/site1 chown -R site1:wwwguest /home/site1 chmod 750 /home/site2 chown -R site2:wwwguest /home/site2 in httpd.conf: === User wwwguest Group wwwguest User site1 Group site1 User site1 Group site1 === So Apache will run as wwwguest and has the access to users files (readonly), but users script are run as their own uid/gid (cause SuExec does it), so they can't access another user's directory. -- Dmitry A. Mottl Network Administrator Skobeltsyn's Institute of Nuclear Physics Moscow State Unversity To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message