cvs: /php4 fopen-wrappers.c main.c rfc1867.c

From: Date: Thu, 30 Mar 2000 22:41:44 +0000
Subject: cvs: /php4 fopen-wrappers.c main.c rfc1867.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-12917@lists.php.net to get a copy of this message
andi Thu Mar 30 14:41:44 2000 EDT Modified files: /php4 fopen-wrappers.c main.c rfc1867.c Log: - Baby steps... Use PHP_FOPEN() Index: php4/fopen-wrappers.c diff -u php4/fopen-wrappers.c:1.48 php4/fopen-wrappers.c:1.49 --- php4/fopen-wrappers.c:1.48 Thu Mar 30 14:39:29 2000 +++ php4/fopen-wrappers.c Thu Mar 30 14:41:13 2000 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.c,v 1.48 2000/03/30 22:39:29 andi Exp $ */ +/* $Id: fopen-wrappers.c,v 1.49 2000/03/30 22:41:13 andi Exp $ */ #include "php.h" #include "php_globals.h" @@ -204,7 +204,7 @@ return NULL; } if (php_check_open_basedir(path)) return NULL; - return fopen(path, mode); + return PHP_FOPEN(path, mode); } } @@ -282,7 +282,7 @@ SG(request_info).path_translated = NULL; return NULL; } - fp = fopen(fn, "r"); + fp = PHP_FOPEN(fn, "r"); /* refuse to open anything that is not a regular file */ if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) { @@ -331,7 +331,7 @@ return NULL; } if (php_check_open_basedir(filename)) return NULL; - fp = fopen(filename, mode); + fp = PHP_FOPEN(filename, mode); if (fp && opened_path) { *opened_path = expand_filepath(filename); } @@ -353,14 +353,14 @@ return NULL; } if (php_check_open_basedir(trypath)) return NULL; - fp = fopen(trypath, mode); + fp = PHP_FOPEN(trypath, mode); if (fp && opened_path) { *opened_path = expand_filepath(trypath); } return fp; } else { if (php_check_open_basedir(filename)) return NULL; - return fopen(filename, mode); + return PHP_FOPEN(filename, mode); } } if (!path || (path && !*path)) { @@ -368,7 +368,7 @@ return NULL; } if (php_check_open_basedir(filename)) return NULL; - fp = fopen(filename, mode); + fp = PHP_FOPEN(filename, mode); if (fp && opened_path) { *opened_path = strdup(filename); } @@ -395,7 +395,7 @@ return NULL; } } - if ((fp = fopen(trypath, mode)) != NULL) { + if ((fp = PHP_FOPEN(trypath, mode)) != NULL) { if (php_check_open_basedir(trypath)) { fclose(fp); efree(pathbuf); @@ -898,7 +898,7 @@ if (php_check_open_basedir((char *) path)) { fp = NULL; } else { - fp = fopen(path, mode); + fp = PHP_FOPEN(path, mode); } } } Index: php4/main.c diff -u php4/main.c:1.229 php4/main.c:1.230 --- php4/main.c:1.229 Fri Mar 24 03:16:24 2000 +++ php4/main.c Thu Mar 30 14:41:13 2000 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.229 2000/03/24 11:16:24 andi Exp $ */ +/* $Id: main.c,v 1.230 2000/03/30 22:41:13 andi Exp $ */ #include <stdio.h> @@ -250,7 +250,7 @@ return; } #endif - log_file = fopen(PG(error_log), "a"); + log_file = PHP_FOPEN(PG(error_log), "a"); if (log_file != NULL) { time(&error_time); strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", localtime_r(&error_time, &tmbuf)); Index: php4/rfc1867.c diff -u php4/rfc1867.c:1.30 php4/rfc1867.c:1.31 --- php4/rfc1867.c:1.30 Sat Feb 26 10:59:29 2000 +++ php4/rfc1867.c Thu Mar 30 14:41:13 2000 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.30 2000/02/26 18:59:29 zeev Exp $ */ +/* $Id: rfc1867.c,v 1.31 2000/03/30 22:41:13 andi Exp $ */ #include <stdio.h> #include "php.h" @@ -254,7 +254,7 @@ } else if ((loc - ptr - 4) <= 0) { fn = "none"; } else { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "File Upload Error - Unable to open temporary file [%s]", fn); SAFE_RETURN;

« previous php.version4 (#12917) next »