cvs: php4(PHP_4_0_5) /ext/standard basic_functions.c

From: Date: Wed, 28 Mar 2001 09:05:50 +0000
Subject: cvs: php4(PHP_4_0_5) /ext/standard basic_functions.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4870@lists.php.net to get a copy of this message
romolo Wed Mar 28 01:05:50 2001 EDT Modified files: (Branch: PHP_4_0_5) /php4/ext/standard basic_functions.c Log: Safe mode check on target introduced in function move_uploaded_file. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.315.2.1 php4/ext/standard/basic_functions.c:1.315.2.2 --- php4/ext/standard/basic_functions.c:1.315.2.1 Mon Mar 19 17:49:56 2001 +++ php4/ext/standard/basic_functions.c Wed Mar 28 01:05:50 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.315.2.1 2001/03/20 01:49:56 sniper Exp $ */ +/* $Id: basic_functions.c,v 1.315.2.2 2001/03/28 09:05:50 romolo Exp $ */ #include "php.h" #include "php_main.h" @@ -2485,7 +2485,11 @@ if (!zend_hash_exists(SG(rfc1867_uploaded_files), Z_STRVAL_PP(path), Z_STRLEN_PP(path)+1)) { RETURN_FALSE; } - + + if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(new_path), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + RETURN_FALSE; + } + V_UNLINK(Z_STRVAL_PP(new_path)); if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==0) { successful=1;

« previous php.cvs (#4870) next »