Bug #69240 [NEW]: is_dir() warns of open_basedir restriction on non-existent directory in config

From: Date: Sun, 15 Mar 2015 10:01:29 +0000
Subject: Bug #69240 [NEW]: is_dir() warns of open_basedir restriction on non-existent directory in config
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191398@lists.php.net to get a copy of this message
From:             andrea dot cristaudo at gmail dot com
Operating system: 
PHP version:      5.5.22
Package:          Safe Mode/open_basedir
Bug Type:         Bug
Bug description:is_dir() warns of open_basedir restriction on non-existent directory in config

Description:
------------
If open_basedir is active, file_exists(), as well as is_dir() and 
is_file(), throw an open_basedir warning if you check a directory
mentioned in the open_basedir configuration if that directory is
non-existent.

Same result on v5.5.9 and v.5.3.3 that I've tested on.

Somehow related to https://bugs.php.net/bug.php?id=41518 and
https://bugs.php.net/bug.php?id=24313

Test script:
---------------
#php -d open_basedir=/tmp -r 'var_dump(is_dir("/tmp"));'

#php -d open_basedir=/tmp2 -r 'var_dump(is_dir("/tmp2"));'

Expected result:
----------------
bool(true)

bool(false)

Actual result:
--------------
bool(true)

PHP Warning:  is_dir(): open_basedir restriction in effect. File(/tmp2)
is not within the allowed path(s): (/tmp2) in Command line code on line
1
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP   2. is_dir() Command line code:1
bool(false)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=69240&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69240&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69240&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69240&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69240&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69240&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69240&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69240&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69240&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69240&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69240&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69240&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69240&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69240&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69240&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69240&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69240&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69240&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69240&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69240&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69240&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#191398) next »