Added target ownership check in function copy for safe_mode operations

This commit is contained in:
Romolo Manfredini 2001-03-23 09:30:51 +00:00
parent 6d41bf1492
commit 01ac20050e
2 changed files with 11 additions and 3 deletions

View file

@ -2490,7 +2490,11 @@ PHP_FUNCTION(move_uploaded_file)
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;