From 1c0b8e6f15e416f011263f2d20b5c0281de9fafc Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 14 Mar 2007 11:08:57 +0000 Subject: - rename SAFEMODE_CHECKFILE to OPENBASEDIR_CHECKPATH (can be used without confusing in head without confusion) - Add safemode and open basedir checks in zip:// wrapper (revert Ilia's patch). Bug found by Stefan Esser in his MOPB-20-2007 --- ext/zip/php_zip.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext/zip/php_zip.h') diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index cbfc9b9502..f194151941 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -30,6 +30,16 @@ extern zend_module_entry zip_module_entry; #include "lib/zip.h" +/* {{{ OPENBASEDIR_CHECKPATH(filename) */ +#if (PHP_MAJOR_VERSION < 6) +#define OPENBASEDIR_CHECKPATH(filename) \ + (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC) +#else +#define OPENBASEDIR_CHECKPATH(filename) \ + php_check_open_basedir(filename TSRMLS_CC) +#endif +/* }}} */ + typedef struct _ze_zip_rsrc { struct zip *za; int index_current; -- cgit v1.2.1