cvs: php4 /ext/db db.c /ext/dbase dbase.c /ext/filepro filepro.c /ext/gd gd.c gd_ctx.c /ext/hyperwave hw.c /ext/oci8 oci8.c /ext/pgsql pgsql.c
/ext/standard basic_functions.c basic_functions.h file.c ftp_fopen_wrapper.c http_fopen_wrapper.c image.c php_fopen_wrapper.c php_fopen_wrappers.h
url_scanner_ex.c /ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c /main fopen_wrappers.c fopen_wrappers.h main.c php_ini.c /sapi/cgi cgi_main.c
/sapi/servlet servlet.c

From: Date: Tue, 31 Jul 2001 07:09:51 +0000
Subject: cvs: php4 /ext/db db.c /ext/dbase dbase.c /ext/filepro filepro.c /ext/gd gd.c gd_ctx.c /ext/hyperwave hw.c /ext/oci8 oci8.c /ext/pgsql pgsql.c
/ext/standard basic_functions.c basic_functions.h file.c ftp_fopen_wrapper.c http_fopen_wrapper.c image.c php_fopen_wrapper.c php_fopen_wrappers.h
url_scanner_ex.c /ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c /main fopen_wrappers.c fopen_wrappers.h main.c php_ini.c /sapi/cgi cgi_main.c
/sapi/servlet servlet.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6439@lists.php.net to get a copy of this message
zeev Tue Jul 31 03:09:51 2001 EDT Modified files: /php4/ext/db db.c /php4/ext/dbase dbase.c /php4/ext/filepro filepro.c /php4/ext/gd gd.c gd_ctx.c /php4/ext/hyperwave hw.c /php4/ext/oci8 oci8.c /php4/ext/pgsql pgsql.c /php4/ext/standard basic_functions.c basic_functions.h file.c ftp_fopen_wrapper.c http_fopen_wrapper.c image.c php_fopen_wrapper.c php_fopen_wrappers.h url_scanner_ex.c /php4/ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c /php4/main fopen_wrappers.c fopen_wrappers.h main.c php_ini.c /php4/sapi/cgi cgi_main.c /php4/sapi/servlet servlet.c Log: More TSRMLS_FETCH annihilation. Enough for today...

Index: php4/ext/db/db.c diff -u php4/ext/db/db.c:1.57 php4/ext/db/db.c:1.58 --- php4/ext/db/db.c:1.57 Tue Jul 31 01:43:51 2001 +++ php4/ext/db/db.c Tue Jul 31 03:09:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: db.c,v 1.57 2001/07/31 05:43:51 zeev Exp $ */ +/* $Id: db.c,v 1.58 2001/07/31 07:09:38 zeev Exp $ */ #define IS_EXT_MODULE #if 1 @@ -307,7 +307,7 @@ return NULL; } - if (php_check_open_basedir(filename)) { + if (php_check_open_basedir(filename TSRMLS_CC)) { return NULL; } Index: php4/ext/dbase/dbase.c diff -u php4/ext/dbase/dbase.c:1.42 php4/ext/dbase/dbase.c:1.43 --- php4/ext/dbase/dbase.c:1.42 Tue Jul 31 01:43:51 2001 +++ php4/ext/dbase/dbase.c Tue Jul 31 03:09:38 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dbase.c,v 1.42 2001/07/31 05:43:51 zeev Exp $ */ +/* $Id: dbase.c,v 1.43 2001/07/31 07:09:38 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -132,7 +132,7 @@ RETURN_FALSE; } - if (php_check_open_basedir(dbf_name->value.str.val)) { + if (php_check_open_basedir(dbf_name->value.str.val TSRMLS_CC)) { RETURN_FALSE; } @@ -599,7 +599,7 @@ RETURN_FALSE; } - if (php_check_open_basedir(Z_STRVAL_P(filename))) { + if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) { RETURN_FALSE; } Index: php4/ext/filepro/filepro.c diff -u php4/ext/filepro/filepro.c:1.36 php4/ext/filepro/filepro.c:1.37 --- php4/ext/filepro/filepro.c:1.36 Mon Jul 30 02:17:51 2001 +++ php4/ext/filepro/filepro.c Tue Jul 31 03:09:39 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filepro.c,v 1.36 2001/07/30 06:17:51 zeev Exp $ */ +/* $Id: filepro.c,v 1.37 2001/07/31 07:09:39 zeev Exp $ */ /* filePro 4.x support developed by Chad Robinson, chadr@brttech.com @@ -218,7 +218,7 @@ RETURN_FALSE; } - if (php_check_open_basedir(workbuf)) { + if (php_check_open_basedir(workbuf TSRMLS_CC)) { RETURN_FALSE; } @@ -316,7 +316,7 @@ RETURN_FALSE; } - if (php_check_open_basedir(workbuf)) { + if (php_check_open_basedir(workbuf TSRMLS_CC)) { RETURN_FALSE; } @@ -540,7 +540,7 @@ RETURN_FALSE; } - if (php_check_open_basedir(workbuf)) { + if (php_check_open_basedir(workbuf TSRMLS_CC)) { RETURN_FALSE; } Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.146 php4/ext/gd/gd.c:1.147 --- php4/ext/gd/gd.c:1.146 Tue Jul 31 01:43:53 2001 +++ php4/ext/gd/gd.c Tue Jul 31 03:09:39 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.146 2001/07/31 05:43:53 zeev Exp $ */ +/* $Id: gd.c,v 1.147 2001/07/31 07:09:39 zeev Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -409,7 +409,7 @@ #ifdef PHP_WIN32 fp = VCWD_FOPEN(Z_STRVAL_PP(file), "rb"); #else - fp = php_fopen_wrapper(Z_STRVAL_PP(file), "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); + fp = php_fopen_wrapper(Z_STRVAL_PP(file), "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL TSRMLS_CC); #endif if (fp == NULL) { php_error(E_WARNING, "ImageFontLoad: unable to open file"); @@ -1100,7 +1100,7 @@ #ifdef PHP_WIN32 fp = VCWD_FOPEN(fn, "rb"); #else - fp = php_fopen_wrapper(fn, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); + fp = php_fopen_wrapper(fn, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL TSRMLS_CC); #endif if (!fp && !socketd) { php_strip_url_passwd(fn); @@ -1312,7 +1312,7 @@ } if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) { - if (!fn || fn == empty_string || php_check_open_basedir(fn)) { + if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) { php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } @@ -3404,13 +3404,13 @@ } /* Check origin file */ - if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org)) { + if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) { php_error (E_WARNING, "%s: invalid origin filename '%s'", get_active_function_name(TSRMLS_C), fn_org); RETURN_FALSE; } /* Check destination file */ - if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest)) { + if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) { php_error (E_WARNING, "%s: invalid destination filename '%s'", get_active_function_name(TSRMLS_C), fn_dest); RETURN_FALSE; } Index: php4/ext/gd/gd_ctx.c diff -u php4/ext/gd/gd_ctx.c:1.9 php4/ext/gd/gd_ctx.c:1.10 --- php4/ext/gd/gd_ctx.c:1.9 Mon Jul 30 04:24:27 2001 +++ php4/ext/gd/gd_ctx.c Tue Jul 31 03:09:39 2001 @@ -49,7 +49,7 @@ } if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) { - if (!fn || fn == empty_string || php_check_open_basedir(fn)) { + if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) { php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn); RETURN_FALSE; } Index: php4/ext/hyperwave/hw.c diff -u php4/ext/hyperwave/hw.c:1.88 php4/ext/hyperwave/hw.c:1.89 --- php4/ext/hyperwave/hw.c:1.88 Tue Jul 31 01:43:54 2001 +++ php4/ext/hyperwave/hw.c Tue Jul 31 03:09:39 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: hw.c,v 1.88 2001/07/31 05:43:54 zeev Exp $ */ +/* $Id: hw.c,v 1.89 2001/07/31 07:09:39 zeev Exp $ */ #include <stdlib.h> #include <errno.h> @@ -2800,7 +2800,8 @@ /* {{{ proto hwdoc hw_new_document(string objrec, string data, int size) Create a new document */ -PHP_FUNCTION(hw_new_document) { +PHP_FUNCTION(hw_new_document) +{ pval *arg1, *arg2, *arg3; char *ptr; hw_document *doc; @@ -2835,7 +2836,8 @@ #define BUFSIZE 8192 /* {{{ proto hwdoc hw_new_document_from_file(string objrec, string filename) Create a new document from a file */ -PHP_FUNCTION(hw_new_document_from_file) { +PHP_FUNCTION(hw_new_document_from_file) +{ pval **arg1, **arg2; int len, type; char *ptr; @@ -2854,7 +2856,7 @@ convert_to_string_ex(arg1); convert_to_string_ex(arg2); - fp = php_fopen_wrapper((*arg2)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); + fp = php_fopen_wrapper((*arg2)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp && !socketd){ if (issock != BAD_URL) { char *tmp = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2)); Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.143 php4/ext/oci8/oci8.c:1.144 --- php4/ext/oci8/oci8.c:1.143 Tue Jul 31 01:44:01 2001 +++ php4/ext/oci8/oci8.c Tue Jul 31 03:09:40 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.143 2001/07/31 05:44:01 zeev Exp $ */ +/* $Id: oci8.c,v 1.144 2001/07/31 07:09:40 zeev Exp $ */ /* TODO list: * @@ -577,7 +577,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "OCI8 Support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.143 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.144 $"); #ifndef PHP_WIN32 php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION ); php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR ); @@ -2930,7 +2930,7 @@ convert_to_string_ex(arg); - if (php_check_open_basedir((*arg)->value.str.val)) { + if (php_check_open_basedir((*arg)->value.str.val TSRMLS_CC)) { RETURN_FALSE; } @@ -3050,7 +3050,7 @@ } if (filename && *filename) { - if (php_check_open_basedir(filename)) { + if (php_check_open_basedir(filename TSRMLS_CC)) { goto bail; } Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.121 php4/ext/pgsql/pgsql.c:1.122 --- php4/ext/pgsql/pgsql.c:1.121 Tue Jul 31 01:44:03 2001 +++ php4/ext/pgsql/pgsql.c Tue Jul 31 03:09:42 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.121 2001/07/31 05:44:03 zeev Exp $ */ +/* $Id: pgsql.c,v 1.122 2001/07/31 07:09:42 zeev Exp $ */ #include <stdlib.h> @@ -1436,7 +1436,7 @@ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, z_pgsql_link, id, "PostgreSQL link", le_link, le_plink); convert_to_string_ex(z_filename); - fp = php_fopen_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE, &issock, &socketd, NULL); + fp = php_fopen_wrapper(Z_STRVAL_PP(z_filename), mode, ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp) { php_error(E_WARNING, "Unable to open %s for logging", Z_STRVAL_PP(z_filename)); Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.370 php4/ext/standard/basic_functions.c:1.371 --- php4/ext/standard/basic_functions.c:1.370 Tue Jul 31 02:28:03 2001 +++ php4/ext/standard/basic_functions.c Tue Jul 31 03:09:43 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.370 2001/07/31 06:28:03 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.371 2001/07/31 07:09:43 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -1552,7 +1552,7 @@ headers=Z_STRVAL_PP(emailhead); } - if (_php_error_log(opt_err,message,opt,headers)==FAILURE) { + if (_php_error_log(opt_err, message, opt, headers TSRMLS_CC)==FAILURE) { RETURN_FALSE; } @@ -1560,7 +1560,7 @@ } /* }}} */ -PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers) +PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) { FILE *logfile; int issock=0, socketd=0;; @@ -1582,7 +1582,7 @@ return FAILURE; break; case 3: /*save to a file*/ - logfile=php_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL); + logfile=php_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL TSRMLS_CC); if(!logfile) { php_error(E_WARNING,"error_log: Unable to write to %s",opt); return FAILURE; Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.83 php4/ext/standard/basic_functions.h:1.84 --- php4/ext/standard/basic_functions.h:1.83 Sat Jul 28 07:36:14 2001 +++ php4/ext/standard/basic_functions.h Tue Jul 31 03:09:44 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.h,v 1.83 2001/07/28 11:36:14 zeev Exp $ */ +/* $Id: basic_functions.h,v 1.84 2001/07/31 07:09:44 zeev Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -122,7 +122,7 @@ typedef int php_stat_len; #endif -PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers); +PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC); #if SIZEOF_INT == 4 /* Most 32-bit and 64-bit systems have 32-bit ints */ Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.175 php4/ext/standard/file.c:1.176 --- php4/ext/standard/file.c:1.175 Tue Jul 31 02:28:03 2001 +++ php4/ext/standard/file.c Tue Jul 31 03:09:44 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.175 2001/07/31 06:28:03 zeev Exp $ */ +/* $Id: file.c,v 1.176 2001/07/31 07:09:44 zeev Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -317,7 +317,7 @@ } convert_to_string_ex(filename); - md.fp = php_fopen_wrapper((*filename)->value.str.val, "rb", use_include_path|ENFORCE_SAFE_MODE, &md.issock, &md.socketd, NULL); + md.fp = php_fopen_wrapper((*filename)->value.str.val, "rb", use_include_path|ENFORCE_SAFE_MODE, &md.issock, &md.socketd, NULL TSRMLS_CC); if (!md.fp && !md.socketd) { if (md.issock != BAD_URL) { char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename)); @@ -497,7 +497,7 @@ } convert_to_string_ex(filename); - fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); + fp = php_fopen_wrapper((*filename)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp && !socketd) { if (issock != BAD_URL) { char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename)); @@ -667,7 +667,7 @@ * We need a better way of returning error messages from * php_fopen_wrapper(). */ - fp = php_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); + fp = php_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp && !socketd) { if (issock != BAD_URL) { char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1)); @@ -1629,7 +1629,7 @@ * We need a better way of returning error messages from * php_fopen_wrapper(). */ - fp = php_fopen_wrapper((*arg1)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); + fp = php_fopen_wrapper((*arg1)->value.str.val,"rb", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp && !socketd){ if (issock != BAD_URL) { char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1)); Index: php4/ext/standard/ftp_fopen_wrapper.c diff -u php4/ext/standard/ftp_fopen_wrapper.c:1.7 php4/ext/standard/ftp_fopen_wrapper.c:1.8 --- php4/ext/standard/ftp_fopen_wrapper.c:1.7 Mon Jun 11 11:14:04 2001 +++ php4/ext/standard/ftp_fopen_wrapper.c Tue Jul 31 03:09:45 2001 @@ -17,7 +17,7 @@ | Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c,v 1.7 2001/06/11 15:14:04 dbeu Exp $ */ +/* $Id: ftp_fopen_wrapper.c,v 1.8 2001/07/31 07:09:45 zeev Exp $ */ #include "php.h" #include "php_globals.h" @@ -79,7 +79,7 @@ /* {{{ php_fopen_url_wrap_ftp */ -FILE *php_fopen_url_wrap_ftp(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) +FILE *php_fopen_url_wrap_ftp(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC) { FILE *fp=NULL; php_url *resource=NULL; Index: php4/ext/standard/http_fopen_wrapper.c diff -u php4/ext/standard/http_fopen_wrapper.c:1.14 php4/ext/standard/http_fopen_wrapper.c:1.15 --- php4/ext/standard/http_fopen_wrapper.c:1.14 Sat Jul 28 07:36:17 2001 +++ php4/ext/standard/http_fopen_wrapper.c Tue Jul 31 03:09:45 2001 @@ -17,7 +17,7 @@ | Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.14 2001/07/28 11:36:17 zeev Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.15 2001/07/31 07:09:45 zeev Exp $ */ #include "php.h" #include "php_globals.h" @@ -70,7 +70,7 @@ /* {{{ php_fopen_url_wrap_http */ -FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) +FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC) { FILE *fp=NULL; php_url *resource=NULL; @@ -85,7 +85,6 @@ zval *response_header; char *http_header_line; int http_header_line_length, http_header_line_size; - TSRMLS_FETCH(); resource = php_url_parse((char *) path); if (resource == NULL) { @@ -276,7 +275,7 @@ if (location[0] != '\0') { zval **response_header_new, *entry, **entryp; - fp = php_fopen_url_wrap_http(location, mode, options, issock, socketd, opened_path); + fp = php_fopen_url_wrap_http(location, mode, options, issock, socketd, opened_path TSRMLS_CC); if (zend_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &response_header_new) == SUCCESS) { entryp = &entry; MAKE_STD_ZVAL(entry); Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.35 php4/ext/standard/image.c:1.36 --- php4/ext/standard/image.c:1.35 Mon Jul 30 01:36:14 2001 +++ php4/ext/standard/image.c Tue Jul 31 03:09:45 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ -/* $Id: image.c,v 1.35 2001/07/30 05:36:14 zeev Exp $ */ +/* $Id: image.c,v 1.36 2001/07/31 07:09:45 zeev Exp $ */ /* * Based on Daniel Schmitt's imageinfo.c which carried the following * Copyright notice. @@ -436,7 +436,7 @@ break; } - fp = php_fopen_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); + fp = php_fopen_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC); if (!fp && !socketd) { if (issock != BAD_URL) { Index: php4/ext/standard/php_fopen_wrapper.c diff -u php4/ext/standard/php_fopen_wrapper.c:1.6 php4/ext/standard/php_fopen_wrapper.c:1.7 --- php4/ext/standard/php_fopen_wrapper.c:1.6 Tue Jun 26 09:33:24 2001 +++ php4/ext/standard/php_fopen_wrapper.c Tue Jul 31 03:09:45 2001 @@ -17,7 +17,7 @@ | Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: php_fopen_wrapper.c,v 1.6 2001/06/26 13:33:24 zeev Exp $ */ +/* $Id: php_fopen_wrapper.c,v 1.7 2001/07/31 07:09:45 zeev Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -33,7 +33,7 @@ /* {{{ php_fopen_url_wrap_php */ -FILE *php_fopen_url_wrap_php(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) +FILE *php_fopen_url_wrap_php(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC) { const char *res = path + 6; Index: php4/ext/standard/php_fopen_wrappers.h diff -u php4/ext/standard/php_fopen_wrappers.h:1.2 php4/ext/standard/php_fopen_wrappers.h:1.3 --- php4/ext/standard/php_fopen_wrappers.h:1.2 Mon Feb 26 01:07:23 2001 +++ php4/ext/standard/php_fopen_wrappers.h Tue Jul 31 03:09:45 2001 @@ -18,13 +18,13 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_fopen_wrappers.h,v 1.2 2001/02/26 06:07:23 andi Exp $ */ +/* $Id: php_fopen_wrappers.h,v 1.3 2001/07/31 07:09:45 zeev Exp $ */ #ifndef PHP_FOPEN_WRAPPERS_H #define PHP_FOPEN_WRAPPERS_H -extern FILE *php_fopen_url_wrap_http(char *, char *, int, int *, int *, char **); -extern FILE *php_fopen_url_wrap_ftp(char *, char *, int, int *, int *, char **); -extern FILE *php_fopen_url_wrap_php(char *, char *, int, int *, int *, char **); +FILE *php_fopen_url_wrap_http(char *, char *, int, int *, int *, char ** TSRMLS_DC); +FILE *php_fopen_url_wrap_ftp(char *, char *, int, int *, int *, char ** TSRMLS_DC); +FILE *php_fopen_url_wrap_php(char *, char *, int, int *, int *, char ** TSRMLS_DC); #endif Index: php4/ext/standard/url_scanner_ex.c diff -u php4/ext/standard/url_scanner_ex.c:1.35 php4/ext/standard/url_scanner_ex.c:1.36 --- php4/ext/standard/url_scanner_ex.c:1.35 Mon Jul 30 02:18:06 2001 +++ php4/ext/standard/url_scanner_ex.c Tue Jul 31 03:09:45 2001 @@ -887,12 +887,9 @@ PHP_MINIT_FUNCTION(url_scanner) { url_adapt_state_ex_t *ctx; - //TSRMLS_FETCH(); ctx = &BG(url_adapt_state_ex); - - ctx->tags = NULL; - + ctx->tags = NULL; REGISTER_INI_ENTRIES(); return SUCCESS; } Index: php4/ext/zlib/php_zlib.h diff -u php4/ext/zlib/php_zlib.h:1.17 php4/ext/zlib/php_zlib.h:1.18 --- php4/ext/zlib/php_zlib.h:1.17 Mon Jul 30 15:39:26 2001 +++ php4/ext/zlib/php_zlib.h Tue Jul 31 03:09:45 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zlib.h,v 1.17 2001/07/30 19:39:26 sniper Exp $ */ +/* $Id: php_zlib.h,v 1.18 2001/07/31 07:09:45 zeev Exp $ */ #ifndef PHP_ZLIB_H #define PHP_ZLIB_H @@ -64,7 +64,7 @@ PHP_FUNCTION(gzencode); PHP_FUNCTION(ob_gzhandler); -FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path); +FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC); int php_enable_output_compression(int buffer_size); Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.90 php4/ext/zlib/zlib.c:1.91 --- php4/ext/zlib/zlib.c:1.90 Tue Jul 31 02:28:03 2001 +++ php4/ext/zlib/zlib.c Tue Jul 31 03:09:46 2001 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.90 2001/07/31 06:28:03 zeev Exp $ */ +/* $Id: zlib.c,v 1.91 2001/07/31 07:09:46 zeev Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -165,7 +165,7 @@ #if HAVE_FOPENCOOKIE if(PG(allow_url_fopen)) { - php_register_url_wrapper("zlib",zlib_fopen_wrapper TSRMLS_CC); + php_register_url_wrapper("zlib", zlib_fopen_wrapper TSRMLS_CC); } #endif @@ -229,12 +229,12 @@ /* {{{ php_gzopen_wrapper */ -static gzFile php_gzopen_wrapper(char *path, char *mode, int options) +static gzFile php_gzopen_wrapper(char *path, char *mode, int options TSRMLS_DC) { FILE *f; int issock=0, socketd=0; - f = php_fopen_wrapper(path, mode, options, &issock, &socketd, NULL); + f = php_fopen_wrapper(path, mode, options, &issock, &socketd, NULL TSRMLS_CC); if (!f) { return NULL; @@ -272,7 +272,7 @@ } convert_to_string_ex(filename); - zp = php_gzopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE); + zp = php_gzopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC); if (!zp) { php_error(E_WARNING,"gzFile(\"%s\") - %s",(*filename)->value.str.val,strerror(errno)); RETURN_FALSE; @@ -332,7 +332,7 @@ * We need a better way of returning error messages from * php_gzopen_wrapper(). */ - zp = php_gzopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE); + zp = php_gzopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC); if (!zp) { php_error(E_WARNING,"gzopen(\"%s\",\"%s\") - %s", (*arg1)->value.str.val, p, strerror(errno)); @@ -640,7 +640,7 @@ * We need a better way of returning error messages from * php_gzopen_wrapper(). */ - zp = php_gzopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE); + zp = php_gzopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC); if (!zp){ php_error(E_WARNING,"ReadGzFile(\"%s\") - %s",(*arg1)->value.str.val,strerror(errno)); RETURN_FALSE; Index: php4/ext/zlib/zlib_fopen_wrapper.c diff -u php4/ext/zlib/zlib_fopen_wrapper.c:1.4 php4/ext/zlib/zlib_fopen_wrapper.c:1.5 --- php4/ext/zlib/zlib_fopen_wrapper.c:1.4 Mon Feb 26 01:07:30 2001 +++ php4/ext/zlib/zlib_fopen_wrapper.c Tue Jul 31 03:09:46 2001 @@ -15,7 +15,7 @@ | Authors: Hartmut Holzgraefe <hartmut@six.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib_fopen_wrapper.c,v 1.4 2001/02/26 06:07:30 andi Exp $ */ +/* $Id: zlib_fopen_wrapper.c,v 1.5 2001/07/31 07:09:46 zeev Exp $ */ #define IS_EXT_MODULE #define _GNU_SOURCE @@ -59,7 +59,7 @@ , gz_closer }; -FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) +FILE *zlib_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC) { struct gz_cookie *gc = NULL; FILE *fp; @@ -75,7 +75,7 @@ path++; - fp = php_fopen_wrapper(path, mode, options|IGNORE_URL, &fissock, &fsocketd, NULL); + fp = php_fopen_wrapper(path, mode, options|IGNORE_URL, &fissock, &fsocketd, NULL TSRMLS_CC); if (!fp) { free(gc); Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.131 php4/main/fopen_wrappers.c:1.132 --- php4/main/fopen_wrappers.c:1.131 Tue Jul 31 02:28:04 2001 +++ php4/main/fopen_wrappers.c Tue Jul 31 03:09:46 2001 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.131 2001/07/31 06:28:04 zeev Exp $ */ +/* $Id: fopen_wrappers.c,v 1.132 2001/07/31 07:09:46 zeev Exp $ */ /* {{{ includes */ @@ -82,15 +82,12 @@ #endif /* }}} */ -typedef FILE * (*php_fopen_url_wrapper_t) (const char *, char *, int, int *, int *, char **) ; - -static FILE *php_fopen_url_wrapper(const char *, char *, int, int *, int *, char **); - -HashTable fopen_url_wrappers_hash; +static FILE *php_fopen_url_wrapper(const char *, char *, int, int *, int *, char ** TSRMLS_DC); +static HashTable fopen_url_wrappers_hash; /* {{{ php_register_url_wrapper */ -PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) TSRMLS_DC) +PHPAPI int php_register_url_wrapper(char *protocol, php_fopen_url_wrapper_t wrapper TSRMLS_DC) { if(PG(allow_url_fopen)) { return zend_hash_add(&fopen_url_wrappers_hash, protocol, strlen(protocol), &wrapper, sizeof(wrapper), NULL); @@ -226,10 +223,9 @@ /* {{{ php_fopen_and_set_opened_path */ -static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path) +static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC) { FILE *fp; - TSRMLS_FETCH(); if (php_check_open_basedir((char *)path TSRMLS_CC)) { return NULL; @@ -244,43 +240,42 @@ /* {{{ php_fopen_wrapper */ -PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) +PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC) { - TSRMLS_FETCH(); - - if(!path) return NULL; - if(!*path) return NULL; - if (opened_path) { *opened_path = NULL; } + if(!path || !*path) { + return NULL; + } + + if(PG(allow_url_fopen)) { if (!(options & IGNORE_URL)) { - return php_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path); + return php_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path TSRMLS_CC); } } if (options & USE_PATH && PG(include_path) != NULL) { - return php_fopen_with_path(path, mode, PG(include_path), opened_path); + return php_fopen_with_path(path, mode, PG(include_path), opened_path TSRMLS_CC); } else { if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!php_checkuid(path, mode, CHECKUID_CHECK_MODE_PARAM))) { return NULL; } - return php_fopen_and_set_opened_path(path, mode, opened_path); + return php_fopen_and_set_opened_path(path, mode, opened_path TSRMLS_CC); } } /* }}} */ /* {{{ php_fopen_primary_script */ -PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle) +PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) { FILE *fp; struct stat st; char *path_info, *filename; int length; - TSRMLS_FETCH(); filename = SG(request_info).path_translated; path_info = SG(request_info).request_uri; @@ -375,7 +370,7 @@ * Tries to open a file with a PATH-style list of directories. * If the filename starts with "." or "/", the path is ignored. */ -PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path) +PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC) { char *pathbuf, *ptr, *end; char *exec_fname; @@ -388,7 +383,6 @@ int filename_length; int safe_mode_include_dir_length; int exec_fname_length; - TSRMLS_FETCH(); if (opened_path) { *opened_path = NULL; @@ -405,7 +399,7 @@ if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { return NULL; } - return php_fopen_and_set_opened_path(filename, mode, opened_path); + return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); } /* @@ -429,7 +423,7 @@ #endif { /* absolute path matches safe_mode_include_dir */ - fp = php_fopen_and_set_opened_path(trypath, mode, opened_path); + fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC); if (fp) { return fp; } @@ -438,14 +432,14 @@ if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { return NULL; } - return php_fopen_and_set_opened_path(filename, mode, opened_path); + return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); } if (!path || (path && !*path)) { if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) { return NULL; } - return php_fopen_and_set_opened_path(filename, mode, opened_path); + return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC); } /* check in provided path */ @@ -491,7 +485,7 @@ #endif { /* trypath is in safe_mode_include_dir */ - fp = php_fopen_and_set_opened_path(trydir, mode, opened_path); + fp = php_fopen_and_set_opened_path(trydir, mode, opened_path TSRMLS_CC); if (fp) { efree(pathbuf); return fp; @@ -504,7 +498,7 @@ return NULL; } } - fp = php_fopen_and_set_opened_path(trypath, mode, opened_path); + fp = php_fopen_and_set_opened_path(trypath, mode, opened_path TSRMLS_CC); if (fp) { efree(pathbuf); return fp; @@ -519,14 +513,13 @@ /* {{{ php_fopen_url_wrapper */ -static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) +static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC) { FILE *fp = NULL; const char *p; const char *protocol=NULL; int n=0; - for (p=path; isalnum((int)*p); p++) { n++; } @@ -542,13 +535,11 @@ protocol=NULL; } if (wrapper) { - return (*wrapper)(path, mode, options, issock, socketd, opened_path); + return (*wrapper)(path, mode, options, issock, socketd, opened_path TSRMLS_CC); } } if (!protocol || !strncasecmp(protocol, "file",n)){ - TSRMLS_FETCH(); - *issock = 0; if(protocol) { @@ -562,12 +553,12 @@ } if (options & USE_PATH) { - fp = php_fopen_with_path((char *) path, mode, PG(include_path), opened_path); + fp = php_fopen_with_path((char *) path, mode, PG(include_path), opened_path TSRMLS_CC); } else { if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!php_checkuid(path, mode, CHECKUID_CHECK_MODE_PARAM))) { fp = NULL; } else { - fp = php_fopen_and_set_opened_path(path, mode, opened_path); + fp = php_fopen_and_set_opened_path(path, mode, opened_path TSRMLS_CC); } } return (fp); Index: php4/main/fopen_wrappers.h diff -u php4/main/fopen_wrappers.h:1.27 php4/main/fopen_wrappers.h:1.28 --- php4/main/fopen_wrappers.h:1.27 Tue Jul 31 02:28:04 2001 +++ php4/main/fopen_wrappers.h Tue Jul 31 03:09:47 2001 @@ -15,7 +15,7 @@ | Authors: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.h,v 1.27 2001/07/31 06:28:04 zeev Exp $ */ +/* $Id: fopen_wrappers.h,v 1.28 2001/07/31 07:09:47 zeev Exp $ */ #ifndef FOPEN_WRAPPERS_H #define FOPEN_WRAPPERS_H @@ -64,15 +64,17 @@ #define IS_SOCKET 1 #define BAD_URL 2 -PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path); +typedef FILE *(*php_fopen_url_wrapper_t)(const char *, char *, int, int *, int *, char ** TSRMLS_DC); -PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle); +PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC); + +PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC); PHPAPI char *expand_filepath(const char *filepath, char *real_path); PHPAPI int php_check_open_basedir(char *path TSRMLS_DC); PHPAPI int php_check_specific_open_basedir(char *basedir, char *path TSRMLS_DC); -PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path); +PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC); PHPAPI int php_is_url(char *path); PHPAPI char *php_strip_url_passwd(char *path); @@ -80,7 +82,7 @@ int php_init_fopen_wrappers(TSRMLS_D); int php_shutdown_fopen_wrappers(TSRMLS_D); -PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) TSRMLS_DC); +PHPAPI int php_register_url_wrapper(char *protocol, php_fopen_url_wrapper_t wrapper TSRMLS_DC); PHPAPI int php_unregister_url_wrapper(char *protocol TSRMLS_DC); #endif Index: php4/main/main.c diff -u php4/main/main.c:1.392 php4/main/main.c:1.393 --- php4/main/main.c:1.392 Tue Jul 31 02:28:04 2001 +++ php4/main/main.c Tue Jul 31 03:09:48 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.392 2001/07/31 06:28:04 zeev Exp $ */ +/* $Id: main.c,v 1.393 2001/07/31 07:09:48 zeev Exp $ */ /* {{{ includes */ @@ -496,9 +496,10 @@ int issock=0, socketd=0; int old_chunk_size; FILE *retval; + TSRMLS_FETCH(); old_chunk_size = php_sock_set_def_chunk_size(1); - retval=php_fopen_wrapper((char *) filename, "rb", USE_PATH|IGNORE_URL_WIN, &issock, &socketd, opened_path); + retval=php_fopen_wrapper((char *) filename, "rb", USE_PATH|IGNORE_URL_WIN, &issock, &socketd, opened_path TSRMLS_CC); php_sock_set_def_chunk_size(old_chunk_size); if (issock) { Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.65 php4/main/php_ini.c:1.66 --- php4/main/php_ini.c:1.65 Tue Jul 31 00:53:52 2001 +++ php4/main/php_ini.c Tue Jul 31 03:09:48 2001 @@ -251,7 +251,7 @@ PG(safe_mode) = 0; PG(open_basedir) = NULL; - fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path); + fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); if (free_ini_search_path) { efree(php_ini_search_path); } Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.124 php4/sapi/cgi/cgi_main.c:1.125 --- php4/sapi/cgi/cgi_main.c:1.124 Tue Jul 31 00:53:53 2001 +++ php4/sapi/cgi/cgi_main.c Tue Jul 31 03:09:48 2001 @@ -707,7 +707,7 @@ } } if (cgi || SG(request_info).path_translated) { - retval = php_fopen_primary_script(&file_handle); + retval = php_fopen_primary_script(&file_handle TSRMLS_CC); } if (cgi && (retval == FAILURE)) { Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.54 php4/sapi/servlet/servlet.c:1.55 --- php4/sapi/servlet/servlet.c:1.54 Tue Jul 31 02:28:05 2001 +++ php4/sapi/servlet/servlet.c Tue Jul 31 03:09:49 2001 @@ -348,7 +348,7 @@ */ SETSTRING( SG(request_info).path_translated, pathTranslated ); #ifdef VIRTUAL_DIR - retval = php_fopen_primary_script(&file_handle); + retval = php_fopen_primary_script(&file_handle TSRMLS_CC); #else /* * The java runtime doesn't like the working directory to be @@ -356,7 +356,7 @@ * in the hopes that Java doesn't notice. */ getcwd(cwd,MAXPATHLEN); - retval = php_fopen_primary_script(&file_handle); + retval = php_fopen_primary_script(&file_handle TSRMLS_CC); chdir(cwd); #endif
« previous php.cvs (#6439) next »