cvs: /php4 fopen-wrappers.c

From: Date: Fri, 07 Apr 2000 22:10:34 +0000
Subject: cvs: /php4 fopen-wrappers.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-13323@lists.php.net to get a copy of this message
zeev Fri Apr 7 15:10:34 2000 EDT Modified files: /php4 fopen-wrappers.c Log: Add a missing expand_filepath() Index: php4/fopen-wrappers.c diff -u php4/fopen-wrappers.c:1.50 php4/fopen-wrappers.c:1.51 --- php4/fopen-wrappers.c:1.50 Fri Mar 31 14:48:59 2000 +++ php4/fopen-wrappers.c Fri Apr 7 15:10:04 2000 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.c,v 1.50 2000/03/31 22:48:59 andi Exp $ */ +/* $Id: fopen-wrappers.c,v 1.51 2000/04/07 22:10:04 zeev Exp $ */ #include "php.h" #include "php_globals.h" @@ -199,12 +199,22 @@ if (options & USE_PATH && PG(include_path) != NULL) { return php_fopen_with_path(path, mode, PG(include_path), opened_path); } else { - if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0; + FILE *fp; + + if (!strcmp(mode,"r") || !strcmp(mode,"r+")) { + cm=0; + } if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!php_checkuid(path, cm))) { return NULL; + } + if (php_check_open_basedir(path)) { + return NULL; + } + fp = PHP_FOPEN(path, mode); + if (fp && opened_path) { + *opened_path = expand_filepath(path); } - if (php_check_open_basedir(path)) return NULL; - return PHP_FOPEN(path, mode); + return fp; } }

« previous php.version4 (#13323) next »