ID:               26310
 User updated by:  coder at paco dot net
 Reported By:      coder at paco dot net
 Status:           Bogus
 Bug Type:         *Directory/Filesystem functions
 Operating System: Solaris 8
 PHP Version:      4.3.4
 New Comment:

Ок, but without ./ the problem still exists.


Previous Comments:
------------------------------------------------------------------------

[2003-11-19 18:36:53] [EMAIL PROTECTED]

sorry, but this is propably the dumbest way to use
open_basedir..allowing ./ is pretty much same as not setting
open_basedir at all:

; open_basedir, if set, limits all file operations to the defined
directory
; and below.  This directive makes most sense if used in a
per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =


------------------------------------------------------------------------

[2003-11-19 03:31:13] coder at paco dot net

Description:
------------
Strange problem with PHP 4.3.4 on Solaris

phpinfo() you can see here http://coder.paco.net/phpinfo.php
test scripts here:
http://coder.paco.net/test/err.php
http://coder.paco.net/err.php

when i try to open file (file('filename.ext')) from root dir everythig
fine, but when from dir "/test" open_basedir restriction error
appears.
With full path to file all ok, with ./ path also ok.

Config line: './configure' '--with-apache=../apache_1.3.27rusPL30.17'
'--with-mod_charset' '--with-gd=/usr/local'
'--with-mysql=/usr/local/mysql' '--with-dbase' '--enable-track-vars'
'--enable-memory-limit' '--with-db3=/usr/local/BerkeleyDB.3.3'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
'--with-freetype-dir=/usr/local' '--with-zlib-dir=/usr/local'
'--with-dom=/usr/local' '--with-iconv=/usr/local'
'--with-mnogosearch=/usr/local/mnogo'

PHP-ini: 
open_basedir    
/opt/www/docs:/opt/www/udocs:/opt/www/virtual:/var/tmp/phpupload:/export/home:../:./
include_path    .:..:/usr/local/lib/php
safe_mode       Off

Reproduce code:
---------------
$file = file("/www/udocs/coder/public_html/test/read.php");
$file = file("read.php"); //error string
$file = file("./read.php");



Expected result:
----------------
I expect all files opened.

Actual result:
--------------
file('/www/udocs/coder/public_html/test/read.php'); open file from
curren dir with full path
Array ( [0] => file in "test" dir )

file('read.php'); open file from curren dir

Warning: file(): open_basedir restriction in effect. File(read.php) is
not within the allowed path(s):
(/opt/www/docs:/opt/www/udocs:/opt/www/virtual:/var/tmp/phpupload:/export/home:../:./)
in /opt/www/udocs/coder/public_html/test/err.php on line 8

Warning: file(read.php): failed to open stream: Not owner in
/opt/www/udocs/coder/public_html/test/err.php on line 8

--

-- $file = file('./read.php'); open file from current dir as ./
Array ( [0] => file in "test" dir ) 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26310&edit=1

Reply via email to