From: philipp at servicemail24 dot de Operating system: Windows XP SP2 PHP version: 5.3.0 PHP Bug Type: *Directory/Filesystem functions Bug description: is_writeable does not work using netshare and normal user rights
Description: ------------ PHP 5.3.0 and 5.3.1RC1 has a bug in the is_readable and is_writeable function if you execute a script with normal windows user rights. The same test script works fine using PHP 5.2.x. Providing admin rights for the user solves the problem but this is not a long term solution for us. All tested PHP releases are VC6 TS PHP 5.2.10 -> OK PHP 5.2.11 -> OK PHP 5.3.0 -> FAILED PHP 5.3.1RC1 -> FAILED Reproduce code: --------------- $folders = array( '\\\\10.1.1.1\\share', '\\\\srv\\share', 'd:/temp' ); foreach($folders as $folder) { if(@!is_readable($folder)) { echo('FAILED is_readable: ' . $folder . "\n"); } else { echo "OK is_readable: " . $folder . "\n"; } if(@!is_writeable($folder)) { echo('FAILED is_writeable: ' . $folder . "\n"); } else { echo "OK is_writeable: " . $folder . "\n"; } $filename = $folder . '\\test.txt'; if(@!file_put_contents($filename, 'php test')) { echo('FAILED file_put_contents: ' . $filename . "\n"); } else { echo "OK file_put_contents: " . $filename . "\n"; } } Expected result: ---------------- OK is_readable: \\10.1.1.1\share OK is_writeable: \\10.1.1.1\share OK file_put_contents: \\10.1.1.1\share\test.txt OK is_readable: \\srv\share OK is_writeable: \\srv\share OK file_put_contents: \\srv\share\test.txt OK is_readable: d:/temp OK is_writeable: d:/temp OK file_put_contents: d:/temp\test.txt Actual result: -------------- FAILED is_readable: \\10.1.1.1\share FAILED is_writeable: \\10.1.1.1\share OK file_put_contents: \\10.1.1.1\share\test.txt FAILED is_readable: \\srv\share FAILED is_writeable: \\srv\share OK file_put_contents: \\srv\share\test.txt OK is_readable: d:/temp OK is_writeable: d:/temp OK file_put_contents: d:/temp\test.txt -- Edit bug report at http://bugs.php.net/?id=49620&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49620&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49620&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49620&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49620&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49620&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49620&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49620&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49620&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49620&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49620&r=support Expected behavior: http://bugs.php.net/fix.php?id=49620&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49620&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49620&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49620&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49620&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49620&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49620&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49620&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49620&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49620&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49620&r=mysqlcfg