#46245 [NEW]: is_writable returns 'true' on read-only files over NFS
| From: | gabe at mudbugmedia dot com | Date: | Mon, 06 Oct 2008 19:54:46 +0000 |
| Subject: | #46245 [NEW]: is_writable returns 'true' on read-only files over NFS | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-129519@lists.php.net to get a copy of this message | ||
From: gabe at mudbugmedia dot com
Operating system: Gentoo Linux 2.6.22-hardened-r8
PHP version: 5.2.6
PHP Bug Type: Filesystem function related
Bug description: is_writable returns 'true' on read-only files over NFS
Description:
------------
When using is_writable() on a read-only file mounted over NFS, it
incorrectly returns true. In our environment, the NFS server is running
MacOSX Server 10.5 mounted with the following fstab options:
10.10.10.10:/Volumes/Sack /sack nfs
rw,rsize=32768,soft,intr,tcp,nosuid 0 1
Reproduce code:
---------------
gabebug@proto /tmp $ ls -ld /sack/test
dr-xr-xr-x 2 joshbug mudbug 68 Oct 6 14:45 /sack/test/
gabebug@proto /tmp $ ls -ld /tmp/test
dr-xr-xr-x 2 joshbug mudbug 4096 Oct 6 14:44 /tmp/test/
gabebug@proto /tmp $ cat is_writable_test.php
<?php
var_dump(
is_writable('/sack/test'), // /sack is the NFS mount
is_writable('/tmp/test')
);
gabebug@proto /tmp $ php -f is_writable_test.php
Expected result:
----------------
bool(false)
bool(false)
Actual result:
--------------
bool(true)
bool(false)
--
Edit bug report at http://bugs.php.net/?id=46245&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46245&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46245&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46245&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46245&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=46245&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46245&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46245&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46245&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46245&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46245&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46245&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46245&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46245&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46245&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46245&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46245&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46245&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46245&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46245&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46245&r=mysqlcfg