Bug #67085 [NEW]: filesystem functions don't handle anonymous pipes correctly

From: Date: Wed, 16 Apr 2014 14:05:54 +0000
Subject: Bug #67085 [NEW]: filesystem functions don't handle anonymous pipes correctly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185267@lists.php.net to get a copy of this message
From: yuri dot kanivetsky at gmail dot com Operating system: arch linux PHP version: 5.5.11 Package: Filesystem function related Bug Type: Bug Bug description:filesystem functions don't handle anonymous pipes correctly Description: ------------ php's filesystem functions can't handle files like /dev/fd/*, e.g.: $ php -d open_basedir= -r 'var_dump(file_get_contents($_SERVER["argv"][1]));' -- <(echo test) As opposed to other languages, including C: $ ruby -e 'p File.read ARGV[0]' <(echo test) $ perl -e 'open F, @ARGV[0]; print <F>' <(echo test) $ cat <(echo test) $ node -e 'var fs = require("fs"); fs.readFile(process.argv[1], "utf8", function(err, data) { console.log(data); })' <(echo test) Please consider explaining what prevents php from opening such files, if you don't consider it a bug. See the following question on unix.stackexchange.com for more details: http://unix.stackexchange.com/questions/74604/how-to-open-process-substituted-file-from-php Test script: --------------- $ php -d open_basedir= -r 'var_dump(file_get_contents($_SERVER["argv"][1]));' -- <(echo test) Expected result: ---------------- test Actual result: -------------- PHP Warning: fopen(/dev/fd/63): failed to open stream: No such file or directory in Command line code on line 1 bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=67085&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67085&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67085&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67085&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67085&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67085&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67085&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67085&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67085&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67085&r=support Expected behavior: https://bugs.php.net/fix.php?id=67085&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67085&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67085&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67085&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67085&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67085&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67085&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67085&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67085&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67085&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67085&r=mysqlcfg

« previous php.bugs (#185267) next »