#35744 [NEW]: safe_mode error?

From: Date: Tue, 20 Dec 2005 12:47:18 +0000
Subject: #35744 [NEW]: safe_mode error?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90711@lists.php.net to get a copy of this message
From:             rudenko at id dot com dot ua
Operating system: Fedora Core 3
PHP version:      5.1.1
PHP Bug Type:     Filesystem function related
Bug description:  safe_mode error?

Description:
------------
Diffrent results for is_file, file_exists and is_readable 

(php.ini safe_mode = On, script executed by root user)


Reproduce code:
---------------
<?php
$file = "/etc/passwd";

echo "File $file:\n";

if (is_file($file)) {
	echo "is_file: true\n";
} else {
	echo "is_file: false\n";
}

if (file_exists($file)) {
	echo "file_exists: true\n";
} else {
	echo "file_exists: false\n";
}

if (is_readable($file)) {
	echo "is_readable: true\n";
} else {
	echo "is_readable: false\n";
}
?>

Expected result:
----------------
is_file: true
file_exists: true
is_readable: true

or 

is_file: false
file_exists: false
is_readable: false



Actual result:
--------------
is_file: false
file_exists: true
is_readable: true


-- 
Edit bug report at http://bugs.php.net/?id=35744&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35744&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35744&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35744&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35744&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=35744&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35744&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35744&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35744&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35744&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35744&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=35744&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=35744&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35744&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35744&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35744&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35744&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35744&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35744&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35744&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35744&r=mysqlcfg


Thread (8 messages)

« previous php.bugs (#90711) next »