summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-06-04 15:38:12 +0000
committerAntony Dovgal <tony2001@php.net>2007-06-04 15:38:12 +0000
commit5c75e5b4f4982000b5b2a871e08fe227af6e755d (patch)
treea2aa2d45e317ae3ba41988e56041fd987952f52d
parent3285bd834b859357bb1320e26d3361b7ba4bfc62 (diff)
downloadphp-git-5c75e5b4f4982000b5b2a871e08fe227af6e755d.tar.gz
MFH: add missing open_basedir checks to CGI
-rw-r--r--sapi/cgi/cgi_main.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 404641fc4c..3e70e45523 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1682,7 +1682,9 @@ consult the installation file that came with this distribution, or visit \n\
*/
retval = FAILURE;
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
@@ -1704,9 +1706,21 @@ consult the installation file that came with this distribution, or visit \n\
goto fastcgi_request_done;
}
#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);
SG(server_context) = NULL;
php_module_shutdown(TSRMLS_C);
+ sapi_shutdown();
+#ifdef ZTS
+ tsrm_shutdown();
+#endif
return FAILURE;
}