#18823 [NEW]: open_basedir not working for include() or readfile()

From: Date: Fri, 09 Aug 2002 04:01:21 +0000
Subject: #18823 [NEW]: open_basedir not working for include() or readfile()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16344@lists.php.net to get a copy of this message
From: matt@haught.com Operating system: FreeBSD-4.4-RELEASE PHP version: 4.2.2 PHP Bug Type: Unknown/Other Function Bug description: open_basedir not working for include() or readfile() 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 bug report at http://bugs.php.net/?id=18823&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18823&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18823&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18823&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18823&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18823&r=support Expected behavior: http://bugs.php.net/fix.php?id=18823&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18823&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18823&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18823&r=globals

« previous php.bugs (#16344) next »