dmitry          Fri Mar  9 16:46:08 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /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.267.2.15.2.29&r2=1.267.2.15.2.30&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.29 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.30
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.29 Tue Feb 27 03:28:17 2007
+++ php-src/sapi/cgi/cgi_main.c Fri Mar  9 16:46:07 2007
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.29 2007/02/27 03:28:17 iliaa Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.30 2007/03/09 16:46:07 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -1705,8 +1705,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");
+                       }
 #if PHP_FASTCGI
                        /* we want to serve more requests if this is fastcgi
                           so cleanup and continue, request shutdown is

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to