From: Markus Fischer Date: Mon, 20 May 2002 18:33:08 +0000 (+0000) Subject: - Add safe_mode/uid and open_basedir check to zip_open() (closes #16927). X-Git-Tag: RELEASE_0_10~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=601cf3690c0fdfc8fc4ad7153018be5c3c4bab30;p=php - Add safe_mode/uid and open_basedir check to zip_open() (closes #16927). --- 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; }