dmitry Fri Mar 9 16:50:17 2007 UTC
Modified files:
/php-src/sapi/cgi cgi_main.c
Log:
Return HTTP 403 in case of "access denied".
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.315&r2=1.316&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.315 php-src/sapi/cgi/cgi_main.c:1.316
--- php-src/sapi/cgi/cgi_main.c:1.315 Wed Feb 21 08:08:47 2007
+++ php-src/sapi/cgi/cgi_main.c Fri Mar 9 16:50:17 2007
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cgi_main.c,v 1.315 2007/02/21 08:08:47 tony2001 Exp $ */
+/* $Id: cgi_main.c,v 1.316 2007/03/09 16:50:17 dmitry Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -1631,8 +1631,13 @@
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 */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php