From cccb406ee82662e827ef3a24d726b3cb732c9cb1 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 16 May 2006 00:39:32 +0000 Subject: [PATCH] Disable realpath cache when open_basedir or safe_mode are enabled on a per-request basis. --- NEWS | 2 ++ main/main.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 0271685f14..9d16f9ab62 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2006, PHP 5.2.0 +- Disable realpath cache when open_basedir or safe_mode are enabled on a + per-request basis. (Ilia) - Optimized require_once/include_once (eliminated fopen() on second usage). (Dmitry) - Optimized request shutdown sequence. Restoring ini directives now diff --git a/main/main.c b/main/main.c index ab35f2ec3d..9335f3dc73 100644 --- a/main/main.c +++ b/main/main.c @@ -1097,6 +1097,11 @@ int php_request_startup(TSRMLS_D) zend_set_timeout(PG(max_input_time)); } + /* Disable realpath cache if safe_mode or open_basedir are set */ + if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { + CWDG(realpath_cache_size_limit) = 0; + } + if (PG(expose_php)) { sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); } -- 2.50.1