summaryrefslogtreecommitdiff
path: root/sapi/cgi
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-03-09 16:46:07 +0000
committerDmitry Stogov <dmitry@php.net>2007-03-09 16:46:07 +0000
commitc2a71f8eb16cfaeabcef08b279f3de55be51a0c5 (patch)
tree53b2d2e02c2bc2f34a3ea684e20d60a425d4d7b2 /sapi/cgi
parent982de65f6e761fe28966f4261bb0176d90bddc46 (diff)
downloadphp-git-c2a71f8eb16cfaeabcef08b279f3de55be51a0c5.tar.gz
Return HTTP 403 in case of "access denied".
Diffstat (limited to 'sapi/cgi')
-rw-r--r--sapi/cgi/cgi_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index d97d75efeb..320b32d00a 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1705,8 +1705,13 @@ consult the installation file that came with this distribution, or visit \n\
running from shell (so fp == NULL), then fail.
*/
if (retval == FAILURE && file_handle.handle.fp == NULL) {
- SG(sapi_headers).http_response_code = 404;
- PUTS("No input file specified.\n");
+ if (errno == EACCES) {
+ SG(sapi_headers).http_response_code = 403;
+ PUTS("Access denied.\n");
+ } else {
+ SG(sapi_headers).http_response_code = 404;
+ PUTS("No input file specified.\n");
+ }
#if PHP_FASTCGI
/* we want to serve more requests if this is fastcgi
so cleanup and continue, request shutdown is