From:             jan at kneschke dot de
Operating system: Linux
PHP version:      4CVS-2003-06-04 (stable)
PHP Bug Type:     CGI related
Bug description:  FCGX_Finish_r() isn't called if no SCRIPT_FILENAME is provided

I'm using a php with the fastcgi-SAPI for my own webserver 
lighttpd. While testing various cases I've found a bug in the 
FastCGI-SAPI in PHP: 
 
If no usefull script-filename is sent to the PHP it would send a 
default error-page with "No input file specified." and status 
404. After sending this messsage the module is shutdown 
without finishing the FastCGI request. This results in a missing 
FCGI_REQUEST_END packet and is against the FastCGI 
spec. 
 
I don't know if the FCGX_Finished_r() should be called before 
or after module_shutdown(). Before actually works fine. 
 
Index: cgi_main.c 
=================================================================== 
RCS file: /repository/php4/sapi/cgi/cgi_main.c,v 
retrieving revision 1.190.2.37 
diff -u -r1.190.2.37 cgi_main.c 
--- cgi_main.c  31 May 2003 17:02:01 -0000      1.190.2.37 
+++ cgi_main.c  4 Jun 2003 07:19:12 -0000 
@@ -1487,6 +1487,9 @@ 
                        SG(sapi_headers).http_response_code = 404; 
                        PUTS("No input file specified.\n"); 
                        php_request_shutdown((void *) 0); 
+#ifdef PHP_FASTCGI 
+                       if (fastcgi) FCGX_Finish_r(&request); 
+#endif 
                        php_module_shutdown(TSRMLS_C); 
                        return FAILURE; 
                } 
-- 
Edit bug report at http://bugs.php.net/?id=24009&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24009&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24009&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24009&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24009&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24009&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24009&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24009&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24009&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24009&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24009&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24009&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24009&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24009&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24009&r=gnused

Reply via email to