summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomolo Manfredini <romolo@php.net>2001-03-28 09:01:27 +0000
committerRomolo Manfredini <romolo@php.net>2001-03-28 09:01:27 +0000
commit2b82b1c47a34a1f236c72800eaea54a2c0e58566 (patch)
treee2b39283371deda835013f5f98bab34a9a2f9e59
parentdaf68d8d91d54b89efdcb7e1280abdb332968534 (diff)
downloadphp-git-2b82b1c47a34a1f236c72800eaea54a2c0e58566.tar.gz
Safe mode check for target introduced in function copy. Pls insert in 4_0_5
-rw-r--r--ext/standard/file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 2808d41a6b..0db94098ee 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1703,6 +1703,10 @@ PHP_FUNCTION(copy)
RETURN_FALSE;
}
+ if (PG(safe_mode) &&(!php_checkuid((*target)->value.str.val, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ RETURN_FALSE;
+ }
+
if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target))==SUCCESS) {
RETURN_TRUE;
} else {