From: Stanislav Malyshev Date: Tue, 10 Jul 2007 18:42:01 +0000 (+0000) Subject: check if write is allowed before writing to error log X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~260 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9993892a184f21d9e995f68e6985aa5706f79eee;p=php check if write is allowed before writing to error log --- diff --git a/main/main.c b/main/main.c index 8a3b350bdb..84f51288d0 100644 --- a/main/main.c +++ b/main/main.c @@ -453,6 +453,9 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) return; } #endif + if (PG(open_basedir) && php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) { + return FAILURE; + } fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); if (fd != -1) { char *tmp;