summaryrefslogtreecommitdiff
path: root/ext/zip/zip.c
diff options
context:
space:
mode:
authorMarkus Fischer <mfischer@php.net>2002-05-20 18:33:08 +0000
committerMarkus Fischer <mfischer@php.net>2002-05-20 18:33:08 +0000
commit601cf3690c0fdfc8fc4ad7153018be5c3c4bab30 (patch)
tree9e45ab33ac58cbd98f85161100c7abb1b32ae98c /ext/zip/zip.c
parent720a890f848ffc4fa26d8f6b5c9db4f85a7c6e01 (diff)
downloadphp-git-601cf3690c0fdfc8fc4ad7153018be5c3c4bab30.tar.gz
- Add safe_mode/uid and open_basedir check to zip_open() (closes #16927).
Diffstat (limited to 'ext/zip/zip.c')
-rw-r--r--ext/zip/zip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/zip/zip.c b/ext/zip/zip.c
index 506552207c..27f72bb224 100644
--- a/ext/zip/zip.c
+++ b/ext/zip/zip.c
@@ -128,9 +128,18 @@ PHP_FUNCTION(zip_open)
return;
}
+ if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_FILE_NOT_EXISTS))) {
+ RETURN_FALSE;
+ }
+
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
archive_p = zzip_opendir(filename);
if (archive_p == NULL) {
- php_error(E_WARNING, "Cannot open zip archive %s", filename);
+ php_error(E_WARNING, "%s() Cannot open zip archive %s",
+ get_active_function_name(TSRMLS_C), filename);
RETURN_FALSE;
}