From 69ff1d0e4dc4d7c4b882c353b5244a8c23c08fb9 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 9 Mar 2007 16:50:17 +0000 Subject: [PATCH] Return HTTP 403 in case of "access denied". --- sapi/cgi/cgi_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 9095c401eb..c56188be0a 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1631,8 +1631,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"); + } /* we want to serve more requests if this is fastcgi so cleanup and continue, request shutdown is handled later */ -- 2.50.1