#18823 [Opn->Csd]: open_basedir not working for include() or readfile()

From: Date: Tue, 27 Aug 2002 02:26:27 +0000
Subject: #18823 [Opn->Csd]: open_basedir not working for include() or readfile()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17898@lists.php.net to get a copy of this message
ID: 18823 User updated by: matt@haught.com Reported By: matt@haught.com -Status: Open +Status: Closed Bug Type: Unknown/Other Function Operating System: FreeBSD-4.4-RELEASE PHP Version: 4.2.2 New Comment: This was fixed in cvs; main/streams.c 1.73 by wez. Previous Comments: ------------------------------------------------------------------------ [2002-08-09 00:01:20] matt@haught.com I am using an Aug 6th cvs build of php4 on apache-1.3.26. I have chrooted apache and I also wanted to use open_basedir to help improve security between users. My open_basedir is set to "/www/admin/:/www/global.include/", and to test open_basedir i created /www/admin/basedir.php which contains: <?php echo 'Include test<br>' include("/etc/resolv.conf"); echo '<br><br>Readfile test <br>'; echo readfile("/etc/resolv.conf"); ?> The result is the printing of my nameservers from outside the open_basedir. I do however get a open_basedir warning for trying to open outside files using fopen/fread and also readdir, but not with include(), include_once(), or readfile(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18823&edit=1

« previous php.bugs (#17898) next »