MFH: add missing open_basedir checks to CGI

This commit is contained in:
Antony Dovgal 2007-06-04 15:38:12 +00:00
parent 3285bd834b
commit 5c75e5b4f4

View File

@ -1682,7 +1682,9 @@ consult the installation file that came with this distribution, or visit \n\
*/ */
retval = FAILURE; retval = FAILURE;
if (cgi || SG(request_info).path_translated) { if (cgi || SG(request_info).path_translated) {
retval = php_fopen_primary_script(&file_handle TSRMLS_CC); if (!php_check_open_basedir(SG(request_info).path_translated TSRMLS_CC)) {
retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
}
} }
/* /*
if we are unable to open path_translated and we are not if we are unable to open path_translated and we are not
@ -1704,9 +1706,21 @@ consult the installation file that came with this distribution, or visit \n\
goto fastcgi_request_done; goto fastcgi_request_done;
} }
#endif #endif
STR_FREE(SG(request_info).path_translated);
if (free_query_string && SG(request_info).query_string) {
free(SG(request_info).query_string);
SG(request_info).query_string = NULL;
}
php_request_shutdown((void *) 0); php_request_shutdown((void *) 0);
SG(server_context) = NULL; SG(server_context) = NULL;
php_module_shutdown(TSRMLS_C); php_module_shutdown(TSRMLS_C);
sapi_shutdown();
#ifdef ZTS
tsrm_shutdown();
#endif
return FAILURE; return FAILURE;
} }