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

 ID:                 53041
 Comment by:         info at riastudio dot fr
 Reported by:        sunseb at live dot com
 Summary:            is_file() and open_basedir
 Status:             Verified
 Type:               Bug
 Package:            *Directory/Filesystem functions
 Operating System:   Linux
 PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

Still occurs in 5.3.5, more than annoying when you have a lot of vhosts
with 

open_basedir + error_reporting E_ALL


Previous Comments:
------------------------------------------------------------------------
[2011-02-02 17:26:18] mjk at emmjaykay dot org

My apologies. But it says "directory: /home/my_file.txt" so I the
directions were a little unclear. sry

------------------------------------------------------------------------
[2011-02-02 12:39:14] sjon at react dot com

apart from you not reproducing the bug correctly (my_file.txt should
obviously be a file, not a directory), this seems to have been fixed by
now.



I suspect this to fix it:



http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/TSRM/tsrm_virtual_cwd.c?r1=264931&r2=264932&;

------------------------------------------------------------------------
[2011-02-01 19:06:53] mjk at emmjaykay dot org

I setup my machine as described in this bug and changed my /etc/php.ini
so that open_basedir = /home/, mkdir /home/my_file.txt and did a touch
/home/my_file.txt/whatever. I then ran this script



<?php

var_dump (is_file("/home/my_file.txt"));

var_dump (is_file("/home/my_file.txt/whatever"));

?>



and got this



bool(false)

bool(true)



Is there another change I need to make to php.ini or something I'm
missing?

------------------------------------------------------------------------
[2011-01-07 14:08:04] sjon at react dot com

this problem still occurs in 5.3.5

------------------------------------------------------------------------
[2010-10-13 02:58:59] uramihsayibok at gmail dot com

Same as bugs #52065 and #44901. Reproduced on Windows.



some file function (eg, is_file) calls the C functions:

-> php_stat

-> php_check_specific_open_basedir(_ex) [1]

-> expand_filepath(_ex)

-> virtual_file_ex

-> tsrm_realpath_r [2]:

Unable to access /home/my_file.txt/whatever, [2] next checks that
/home/my_file.txt exists *and is a directory*. Since it isn't a
directory, everything fails all the way back up to [1], which then,
assuming it was a problem specifically with the open_basedir
restriction, issues the warning.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=53041


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

Reply via email to