cvs: /php4 fopen-wrappers.c fopen-wrappers.h main.c php4dllts.dsp /php4/ext/gd gd.c /php4/ext/standard basic_functions.c file.c

From: Date: Tue, 30 Nov 1999 20:18:13 +0000
Subject: cvs: /php4 fopen-wrappers.c fopen-wrappers.h main.c php4dllts.dsp /php4/ext/gd gd.c /php4/ext/standard basic_functions.c file.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-7106@lists.php.net to get a copy of this message
andi Tue Nov 30 15:18:13 1999 EDT Modified files: /php4 fopen-wrappers.c fopen-wrappers.h main.c php4dllts.dsp /php4/ext/gd gd.c /php4/ext/standard basic_functions.c file.c Log: - Added opened_path to php_fopen_wrapper() and the URL fopen wrapper (it's not always properly set, it's a TODO for all of us). This enables us to implement true 'use' support. Index: php4/fopen-wrappers.c diff -u php4/fopen-wrappers.c:1.30 php4/fopen-wrappers.c:1.31 --- php4/fopen-wrappers.c:1.30 Thu Nov 11 08:49:42 1999 +++ php4/fopen-wrappers.c Tue Nov 30 15:18:06 1999 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.c,v 1.30 1999/11/11 13:49:42 thies Exp $ */ +/* $Id: fopen-wrappers.c,v 1.31 1999/11/30 20:18:06 andi Exp $ */ /* Synced with php3 revision 1.66 1999-06-18 [ssb] */ @@ -79,7 +79,7 @@ #include <sys/un.h> #endif -static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd); +static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path); int _php3_getftpresult(int socketd); @@ -181,7 +181,7 @@ return 0; } -PHPAPI FILE *php3_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd) +PHPAPI FILE *php3_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) { int cm=2; /* checkuid mode: 2 = if file does not exist, check directory */ PLS_FETCH(); @@ -190,12 +190,12 @@ be runtime enabled, NOT compile time. */ #if PHP3_URL_FOPEN if (!(options & IGNORE_URL)) { - return php3_fopen_url_wrapper(path, mode, options, issock, socketd); + return php3_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path); } #endif if (options & USE_PATH && PG(include_path) != NULL) { - return php3_fopen_with_path(path, mode, PG(include_path), NULL); + return php3_fopen_with_path(path, mode, PG(include_path), opened_path); } else { if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0; if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!_php3_checkuid(path, cm))) { @@ -427,7 +427,7 @@ * Otherwise, fopen is called as usual and the file pointer is returned. */ -static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd) +static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) { url *resource; int result; @@ -590,7 +590,7 @@ *socketd = 0; free_url(resource); if (location[0] != '\0') { - return php3_fopen_url_wrapper(location, mode, options, issock, socketd); + return php3_fopen_url_wrapper(location, mode, options, issock, socketd, opened_path); } else { return NULL; } @@ -883,12 +883,11 @@ free_url(resource); *issock = 1; return (fp); - } else { PLS_FETCH(); if (options & USE_PATH) { - fp = php3_fopen_with_path((char *) path, mode, PG(include_path), NULL); + fp = php3_fopen_with_path((char *) path, mode, PG(include_path), opened_path); } else { int cm=2; if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0; Index: php4/fopen-wrappers.h diff -u php4/fopen-wrappers.h:1.9 php4/fopen-wrappers.h:1.10 --- php4/fopen-wrappers.h:1.9 Fri Oct 15 11:22:19 1999 +++ php4/fopen-wrappers.h Tue Nov 30 15:18:06 1999 @@ -15,7 +15,7 @@ | Authors: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.h,v 1.9 1999/10/15 15:22:19 thies Exp $ */ +/* $Id: fopen-wrappers.h,v 1.10 1999/11/30 20:18:06 andi Exp $ */ /* Synced with php3 revision 1.25 1999-06-16 [ssb] */ @@ -66,7 +66,7 @@ #define IS_SOCKET 1 #define BAD_URL 2 -extern PHPAPI FILE *php3_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd); +extern PHPAPI FILE *php3_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path); PHPAPI FILE *php3_fopen_for_parser(void); Index: php4/main.c diff -u php4/main.c:1.140 php4/main.c:1.141 --- php4/main.c:1.140 Fri Nov 26 11:32:02 1999 +++ php4/main.c Tue Nov 30 15:18:06 1999 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.140 1999/11/26 16:32:02 sas Exp $ */ +/* $Id: main.c,v 1.141 1999/11/30 20:18:06 andi Exp $ */ #include <stdio.h> @@ -573,14 +573,14 @@ } -static FILE *php_fopen_wrapper_for_zend(const char *filename) +static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path) { int issock=0, socketd=0; int old_chunk_size; FILE *retval; old_chunk_size = _php3_sock_set_def_chunk_size(1); - retval=php3_fopen_wrapper((char *) filename, "r", USE_PATH|IGNORE_URL_WIN, &issock, &socketd); + retval=php3_fopen_wrapper((char *) filename, "r", USE_PATH|IGNORE_URL_WIN, &issock, &socketd, opened_path); _php3_sock_set_def_chunk_size(old_chunk_size); if (issock) { Index: php4/php4dllts.dsp diff -u php4/php4dllts.dsp:1.36 php4/php4dllts.dsp:1.37 --- php4/php4dllts.dsp:1.36 Sat Nov 27 12:11:20 1999 +++ php4/php4dllts.dsp Tue Nov 30 15:18:06 1999 @@ -893,6 +893,10 @@ SOURCE=".\php.ini-dist" # End Source File +# Begin Source File + +SOURCE=".\README.CVS-RULES" +# End Source File # End Group # End Target # End Project Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.22 php4/ext/gd/gd.c:1.23 --- php4/ext/gd/gd.c:1.22 Mon Nov 29 18:21:52 1999 +++ php4/ext/gd/gd.c Tue Nov 30 15:18:09 1999 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.22 1999/11/29 23:21:52 steffann Exp $ */ +/* $Id: gd.c,v 1.23 1999/11/30 20:18:09 andi Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -312,7 +312,7 @@ #if WIN32|WINNT fp = fopen(file->value.str.val, "rb"); #else - fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd); + fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif if (fp == NULL) { php_error(E_WARNING, "ImageFontLoad: unable to open file"); @@ -416,7 +416,7 @@ #if WIN32|WINNT fp = fopen(file->value.str.val, "rb"); #else - fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd); + fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif if (!fp) { php3_strip_url_passwd(fn); @@ -526,7 +526,7 @@ #if WIN32|WINNT fp = fopen(file->value.str.val, "rb"); #else - fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd); + fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif if (!fp) { php3_strip_url_passwd(fn); Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.128 php4/ext/standard/basic_functions.c:1.129 --- php4/ext/standard/basic_functions.c:1.128 Sat Nov 27 19:31:01 1999 +++ php4/ext/standard/basic_functions.c Tue Nov 30 15:18:10 1999 @@ -925,7 +925,7 @@ case 1: /*send an email*/ { #if HAVE_SENDMAIL - if (!_php3_mail(opt,"PHP3 error_log message",message,headers)){ + if (!_php3_mail(opt,"PHP error_log message",message,headers)){ return FAILURE; } #else @@ -939,7 +939,7 @@ return FAILURE; break; case 3: /*save to a file*/ - logfile=php3_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd); + logfile=php3_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL); if(!logfile) { php_error(E_WARNING,"error_log: Unable to write to %s",opt); return FAILURE; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.43 php4/ext/standard/file.c:1.44 --- php4/ext/standard/file.c:1.43 Wed Nov 24 12:56:31 1999 +++ php4/ext/standard/file.c Tue Nov 30 15:18:11 1999 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.43 1999/11/24 17:56:31 sas Exp $ */ +/* $Id: file.c,v 1.44 1999/11/30 20:18:11 andi Exp $ */ /* Synced with php3 revision 1.218 1999-06-16 [ssb] */ @@ -411,7 +411,7 @@ } convert_to_string_ex(filename); - fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd); + fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); if (!fp && !socketd) { if (issock != BAD_URL) { char *tmp = estrdup((*filename)->value.str.val); @@ -535,7 +535,7 @@ } convert_to_string_ex(filename); - fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd); + fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); if (!fp && !socketd) { if (issock != BAD_URL) { char *tmp = estrdup((*filename)->value.str.val); @@ -652,7 +652,7 @@ * We need a better way of returning error messages from * php3_fopen__wrapper(). */ - fp = php3_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd); + fp = php3_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); if (!fp && !socketd) { if (issock != BAD_URL) { char *tmp = estrdup((*arg1)->value.str.val); @@ -1320,7 +1320,7 @@ * We need a better way of returning error messages from * php3_fopen_wrapper(). */ - fp = php3_fopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd); + fp = php3_fopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL); if (!fp && !socketd){ if (issock != BAD_URL) { char *tmp = estrdup((*arg1)->value.str.val);

« previous php.version4 (#7106) next »