stas Thu Jul 9 00:21:18 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/main main.c Log: fix mail.log openbasedir interaction with .htaccess http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.57.2.56&r2=1.640.2.23.2.57.2.57&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.57.2.56 php-src/main/main.c:1.640.2.23.2.57.2.57 --- php-src/main/main.c:1.640.2.23.2.57.2.56 Tue Jul 7 16:42:11 2009 +++ php-src/main/main.c Thu Jul 9 00:21:17 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.640.2.23.2.57.2.56 2009/07/07 16:42:11 jani Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.57.2.57 2009/07/09 00:21:17 stas Exp $ */ /* {{{ includes */ @@ -367,6 +367,26 @@ /* {{{ PHP_INI_MH */ +static PHP_INI_MH(OnUpdateMailLog) +{ + /* Only do the safemode/open_basedir check at runtime */ + if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) { + if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + return FAILURE; + } + + if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) { + return FAILURE; + } + + } + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_INI_MH + */ static PHP_INI_MH(OnChangeMailForceExtra) { /* Don't allow changing it in htaccess */ @@ -487,7 +507,7 @@ PHP_INI_ENTRY("SMTP", "localhost",PHP_INI_ALL, NULL) PHP_INI_ENTRY("smtp_port", "25", PHP_INI_ALL, NULL) STD_PHP_INI_BOOLEAN("mail.add_x_header", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, mail_x_header, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("mail.log", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, mail_log, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("mail.log", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateMailLog, mail_log, php_core_globals, core_globals) PHP_INI_ENTRY("browscap", NULL, PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY("memory_limit", "128M", PHP_INI_ALL, OnChangeMemoryLimit) PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php