From: pviet at azuria dot com Operating system: Linux PHP version: 4.3.9 PHP Bug Type: CGI related Bug description: 404 instead of 403 when permission denied
Description: ------------ Status 404 instead of 403 when file passed via environment is not accessible. This leads to error on debugging and took me about 7hrs to find what was really happening (wrong rights) Reproduce code: --------------- Abstract : - A PHP file is called x.php, located in /data/www/x.php - My user is called someunixuser - This someunixuser can't read the file because lacking unix permissions (not owner, 0700 or so on) mybox:~$ cat /data/www/x.php cat: /data/www/x.php: Permission denied mybox:~$ env SCRIPT_FILENAME=/data/www/x.php /usr/bin/php Status: 404 Content-type: text/html X-Powered-By: PHP/4.3.9 No input file specified. mybox:~$ Expected result: ---------------- Return a 403 and "Permission denied on /data/web/x.php" Actual result: -------------- Return a 404 and "No input files" -- Edit bug report at http://bugs.php.net/?id=30279&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30279&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30279&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30279&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30279&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30279&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30279&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30279&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30279&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30279&r=support Expected behavior: http://bugs.php.net/fix.php?id=30279&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30279&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30279&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30279&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30279&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30279&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30279&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30279&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30279&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30279&r=mysqlcfg